You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/12 06:18:37 UTC

[GitHub] [nuttx] anjiahao1 opened a new pull request, #8094: mm: Integrate TLSF manager

anjiahao1 opened a new pull request, #8094:
URL: https://github.com/apache/nuttx/pull/8094

   can be enabled by CONFIG_MM_TLSF_MANAGER=y
   
   Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
   Signed-off-by: anjiahao <an...@xiaomi.com>
   
   ## Summary
   Support tlsf memory management algorithm
   ## Impact
   Noting
   ## Testing
   Vela
   
   This algorithm has less memory consumption and faster free speed O(1) than the nuttx default algorithm, but the memory fragmentation problem is worse than the nuttx default algorithm in the long-term test.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8094: mm: Integrate TLSF manager

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8094:
URL: https://github.com/apache/nuttx/pull/8094#discussion_r1070298582


##########
mm/tlsf/Make.defs:
##########
@@ -0,0 +1,47 @@
+############################################################################
+# mm/tlsf/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# tlfs memory allocator
+
+ifeq ($(CONFIG_MM_TLSF_MANAGER),y)
+
+TLSF = tlsf/tlsf/.git
+$(TLSF):
+	$(Q) echo "Downloading: tlsf"
+	$(Q) git clone git@github.com:mattconte/tlsf.git tlsf/tlsf
+	$(Q) patch -p0 < tlsf/0001-Add-TLSF_API-and-tlsf_printf.patch
+	$(Q) patch -p0 < tlsf/0002-Define-_DEBUG-to-0-if-not-done-yet.patch
+	$(Q) patch -p0 < tlsf/0003-Support-customize-FL_INDEX_MAX-to-reduce-the-memory-.patch
+	$(Q) patch -p0 < tlsf/0004-Add-tlsf_extend_pool-function.patch
+	$(Q) patch -p0 < tlsf/0005-Fix-warnining-on-implicit-pointer-conversion.patch
+context::$(TLSF)
+
+distclean::
+	$(Q) rm -rf tlsf/tlsf
+
+CSRCS += mm_tlsf.c tlsf.c
+
+CFLAGS += ${shell $(DEFINE) "$(CC)" tlsf_printf=()}

Review Comment:
   ```suggestion
   CFLAGS += ${shell $(DEFINE) "$(CC)" tlsf_printf=merr}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 merged pull request #8094: mm: Integrate TLSF manager

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #8094:
URL: https://github.com/apache/nuttx/pull/8094


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8094: mm: Integrate TLSF manager

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8094:
URL: https://github.com/apache/nuttx/pull/8094#discussion_r1067932861


##########
mm/tlsf/0006-tlfs-fix-link-failed.patch:
##########
@@ -0,0 +1,31 @@
+From 24a394b8cea3198647b45feae8cf6b875b5bab8f Mon Sep 17 00:00:00 2001
+From: Jiuzhu Dong <do...@xiaomi.com>
+Date: Fri, 19 Aug 2022 23:03:42 +0800
+Subject: [PATCH 6/8] tlfs: fix link failed
+
+VELAPLATFO-3223
+
+nuttx/mm/tlsf/tlsf/tlsf.c:1023: undefined reference to `merr'
+/usr/bin/ld: /home/djz/workspace/test/sim/nuttx/mm/tlsf/tlsf/tlsf.c:1032: undefined reference to `merr'
+
+Change-Id: I7c59c623ef47a4479adfff5e37c2825ab9d3db78
+Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
+---
+ tlsf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tlsf.c tlsf/tlsf/tlsf.c
+index 536bdff..75c7129 100644
+--- a/tlsf.c
++++ tlsf/tlsf/tlsf.c
+@@ -4,6 +4,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <debug.h>

Review Comment:
   let's map tlsf_printf to NULL and remove mm/tlsf/0006-tlfs-fix-link-failed.patch



##########
mm/tlsf/Make.defs:
##########
@@ -0,0 +1,48 @@
+############################################################################
+# mm/tlsf/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# tlfs memory allocator
+
+ifeq ($(CONFIG_MM_TLSF_MANAGER),y)
+
+TLSF = tlsf/tlsf
+$(TLSF):
+	$(Q) echo "Downloading: tlsf"
+	$(Q) git clone git@github.com:mattconte/tlsf.git tlsf/tlsf
+	$(Q) patch -p0 < tlsf/0001-Add-TLSF_API-and-tlsf_printf.patch
+	$(Q) patch -p0 < tlsf/0002-Define-_DEBUG-to-0-if-not-done-yet.patch
+	$(Q) patch -p0 < tlsf/0003-Support-customize-FL_INDEX_MAX-to-reduce-the-memory-.patch
+	$(Q) patch -p0 < tlsf/0004-Add-tlsf_extend_pool-function.patch
+	$(Q) patch -p0 < tlsf/0005-Fix-warnining-on-implicit-pointer-conversion.patch
+	$(Q) patch -p0 < tlsf/0006-tlfs-fix-link-failed.patch
+context::$(TLSF)

Review Comment:
   need check .git before download



##########
mm/tlsf/0008-Revert-tlsf-swtich-last-bit-effect.patch:
##########
@@ -0,0 +1,67 @@
+From a98e770e9439ba8d27b73f899a206bda430073c3 Mon Sep 17 00:00:00 2001

Review Comment:
   remove the file and 0007-tlsf-swtich-last-bit-effect.patch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8094: mm: Integrate TLSF manager

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8094:
URL: https://github.com/apache/nuttx/pull/8094#discussion_r1070297500


##########
mm/tlsf/Make.defs:
##########
@@ -0,0 +1,48 @@
+############################################################################
+# mm/tlsf/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# tlfs memory allocator
+
+ifeq ($(CONFIG_MM_TLSF_MANAGER),y)
+
+TLSF = tlsf/tlsf
+$(TLSF):
+	$(Q) echo "Downloading: tlsf"
+	$(Q) git clone git@github.com:mattconte/tlsf.git tlsf/tlsf
+	$(Q) patch -p0 < tlsf/0001-Add-TLSF_API-and-tlsf_printf.patch
+	$(Q) patch -p0 < tlsf/0002-Define-_DEBUG-to-0-if-not-done-yet.patch
+	$(Q) patch -p0 < tlsf/0003-Support-customize-FL_INDEX_MAX-to-reduce-the-memory-.patch
+	$(Q) patch -p0 < tlsf/0004-Add-tlsf_extend_pool-function.patch
+	$(Q) patch -p0 < tlsf/0005-Fix-warnining-on-implicit-pointer-conversion.patch
+	$(Q) patch -p0 < tlsf/0006-tlfs-fix-link-failed.patch
+context::$(TLSF)

Review Comment:
   All patches are waiting for merging: https://github.com/mattconte/tlsf/pulls



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] anjiahao1 commented on a diff in pull request #8094: mm: Integrate TLSF manager

Posted by GitBox <gi...@apache.org>.
anjiahao1 commented on code in PR #8094:
URL: https://github.com/apache/nuttx/pull/8094#discussion_r1070306024


##########
mm/tlsf/Make.defs:
##########
@@ -0,0 +1,47 @@
+############################################################################
+# mm/tlsf/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# tlfs memory allocator
+
+ifeq ($(CONFIG_MM_TLSF_MANAGER),y)
+
+TLSF = tlsf/tlsf/.git
+$(TLSF):
+	$(Q) echo "Downloading: tlsf"
+	$(Q) git clone git@github.com:mattconte/tlsf.git tlsf/tlsf
+	$(Q) patch -p0 < tlsf/0001-Add-TLSF_API-and-tlsf_printf.patch
+	$(Q) patch -p0 < tlsf/0002-Define-_DEBUG-to-0-if-not-done-yet.patch
+	$(Q) patch -p0 < tlsf/0003-Support-customize-FL_INDEX_MAX-to-reduce-the-memory-.patch
+	$(Q) patch -p0 < tlsf/0004-Add-tlsf_extend_pool-function.patch
+	$(Q) patch -p0 < tlsf/0005-Fix-warnining-on-implicit-pointer-conversion.patch
+context::$(TLSF)
+
+distclean::
+	$(Q) rm -rf tlsf/tlsf
+
+CSRCS += mm_tlsf.c tlsf.c
+
+CFLAGS += ${shell $(DEFINE) "$(CC)" tlsf_printf=()}

Review Comment:
   but,not include <debug.h>,merr is not define



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] acassis commented on a diff in pull request #8094: mm: Integrate TLSF manager

Posted by GitBox <gi...@apache.org>.
acassis commented on code in PR #8094:
URL: https://github.com/apache/nuttx/pull/8094#discussion_r1068072296


##########
mm/tlsf/Make.defs:
##########
@@ -0,0 +1,48 @@
+############################################################################
+# mm/tlsf/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# tlfs memory allocator
+
+ifeq ($(CONFIG_MM_TLSF_MANAGER),y)
+
+TLSF = tlsf/tlsf
+$(TLSF):
+	$(Q) echo "Downloading: tlsf"
+	$(Q) git clone git@github.com:mattconte/tlsf.git tlsf/tlsf
+	$(Q) patch -p0 < tlsf/0001-Add-TLSF_API-and-tlsf_printf.patch
+	$(Q) patch -p0 < tlsf/0002-Define-_DEBUG-to-0-if-not-done-yet.patch
+	$(Q) patch -p0 < tlsf/0003-Support-customize-FL_INDEX_MAX-to-reduce-the-memory-.patch
+	$(Q) patch -p0 < tlsf/0004-Add-tlsf_extend_pool-function.patch
+	$(Q) patch -p0 < tlsf/0005-Fix-warnining-on-implicit-pointer-conversion.patch
+	$(Q) patch -p0 < tlsf/0006-tlfs-fix-link-failed.patch
+context::$(TLSF)

Review Comment:
   Why to download and apply external patches? Since you own the patches, please include the patches in the final code and get rid of downloading it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8094: mm: Integrate TLSF manager

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8094:
URL: https://github.com/apache/nuttx/pull/8094#discussion_r1070297500


##########
mm/tlsf/Make.defs:
##########
@@ -0,0 +1,48 @@
+############################################################################
+# mm/tlsf/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+# tlfs memory allocator
+
+ifeq ($(CONFIG_MM_TLSF_MANAGER),y)
+
+TLSF = tlsf/tlsf
+$(TLSF):
+	$(Q) echo "Downloading: tlsf"
+	$(Q) git clone git@github.com:mattconte/tlsf.git tlsf/tlsf
+	$(Q) patch -p0 < tlsf/0001-Add-TLSF_API-and-tlsf_printf.patch
+	$(Q) patch -p0 < tlsf/0002-Define-_DEBUG-to-0-if-not-done-yet.patch
+	$(Q) patch -p0 < tlsf/0003-Support-customize-FL_INDEX_MAX-to-reduce-the-memory-.patch
+	$(Q) patch -p0 < tlsf/0004-Add-tlsf_extend_pool-function.patch
+	$(Q) patch -p0 < tlsf/0005-Fix-warnining-on-implicit-pointer-conversion.patch
+	$(Q) patch -p0 < tlsf/0006-tlfs-fix-link-failed.patch
+context::$(TLSF)

Review Comment:
   All patch is waiting for merging: https://github.com/mattconte/tlsf/pulls



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org