Skip to contentSkip to conversation

min_free_kbytes limit

PATCH In review Levent Serinol 2 participants 5 messages Mar 23, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 min_free_kbytes limit

=================================================================

mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 renamed from mm/page_alloc.c.org 2005-03-16 02:09:27.000000000 +0200 +6 -1
@@ -1946,11 +1946,16 @@ static void setup_per_zone_lowmem_reserv
  */
 static void setup_per_zone_pages_min(void)
 {
-       unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
+       unsigned long pages_min;
        unsigned long lowmem_pages = 0;
        struct zone *zone;
        unsigned long flags;
 
+       if (min_free_kbytes < 128)
+                min_free_kbytes = 128;
+        if (min_free_kbytes > 65536)
+                min_free_kbytes = 65536;
+       pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
        /* Calculate total number of !ZONE_HIGHMEM pages */
        for_each_zone(zone) {
                if (!is_highmem(zone))

=================================================================

Signature · 7 lines
Stay out of the road, if you want to grow old. 
~ Pink Floyd ~.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#1 lore raw
Quoted 8 lines · Levent Serinol

=================================================================

mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 renamed from mm/page_alloc.c.org 2005-03-16 02:09:27.000000000 +0200 +0 -1
@@ -1946,11 +1946,16 @@ static void setup_per_zone_lowmem_reserv
  */
 static void setup_per_zone_pages_min(void)
 {
-       unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);

mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 static void setup_per_zone_lowmem_reserv · line 1958

Quoted 10 lines
mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 renamed from mm/page_alloc.c.org 2005-03-16 02:09:27.000000000 +0200 +6 -0
+       unsigned long pages_min;
        unsigned long lowmem_pages = 0;
        struct zone *zone;
        unsigned long flags;
 
+       if (min_free_kbytes < 128)
+                min_free_kbytes = 128;
+        if (min_free_kbytes > 65536)
+                min_free_kbytes = 65536;
+       pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);

Who says 65MB of free ram is enough? Where did you get these numbers
from?

mh

Quoted 13 lines
mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 renamed from mm/page_alloc.c.org 2005-03-16 02:09:27.000000000 +0200 +0 -0
        /* Calculate total number of !ZONE_HIGHMEM pages */
        for_each_zone(zone) {
                if (!is_highmem(zone))

=================================================================

Signature · 7 lines
Stay out of the road, if you want to grow old. 
~ Pink Floyd ~.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Signature · 6 lines
Martin Hicks || [email protected] || PGP/GnuPG: 0x4C7F2BEE
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#2 lore raw

init_per_zone_pages_min() function. The problem with min_free_kbytes is, it's integer and accepts signed values. There should be something to like this to avoid problems for example setting min_free_kbytes value to below zero.

Quoted 43 lines · Martin Hicks
Quoted 8 lines · Levent Serinol

=================================================================

mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 renamed from mm/page_alloc.c.org 2005-03-16 02:09:27.000000000 +0200 +0 -1
@@ -1946,11 +1946,16 @@ static void setup_per_zone_lowmem_reserv
  */
 static void setup_per_zone_pages_min(void)
 {
-       unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);

mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 static void setup_per_zone_lowmem_reserv · line 1958

Quoted 10 lines
mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 renamed from mm/page_alloc.c.org 2005-03-16 02:09:27.000000000 +0200 +6 -0
+       unsigned long pages_min;
        unsigned long lowmem_pages = 0;
        struct zone *zone;
        unsigned long flags;
 
+       if (min_free_kbytes < 128)
+                min_free_kbytes = 128;
+        if (min_free_kbytes > 65536)
+                min_free_kbytes = 65536;
+       pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);

Who says 65MB of free ram is enough? Where did you get these numbers
from?

mh

Quoted 6 lines
mm/page_alloc.c 2005-03-23 13:13:47.000000000 +0200 renamed from mm/page_alloc.c.org 2005-03-16 02:09:27.000000000 +0200 +0 -0
        /* Calculate total number of !ZONE_HIGHMEM pages */
        for_each_zone(zone) {
                if (!is_highmem(zone))

=================================================================
--

Quoted 7 lines

Stay out of the road, if you want to grow old.
~ Pink Floyd ~.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
Martin Hicks || [email protected] || PGP/GnuPG: 0x4C7F2BEE

Signature · 7 lines
Stay out of the road, if you want to grow old. 
~ Pink Floyd ~.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#3 lore raw
Quoted 5 lines · Levent Serinol

init_per_zone_pages_min() function. The problem with min_free_kbytes is, it's integer and accepts signed values. There should be something to like this to avoid problems for example setting min_free_kbytes value to below zero.

min_free_kbytes is limited to > 0 by the sysctl handler in kernel/sysctl.c

mh

Signature · 6 lines
Martin Hicks || [email protected] || PGP/GnuPG: 0x4C7F2BEE
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#4 lore raw

right, I missed sysctl part :-(

Quoted 16 lines · Martin Hicks
Quoted 5 lines · Levent Serinol

init_per_zone_pages_min() function. The problem with min_free_kbytes is, it's integer and accepts signed values. There should be something to like this to avoid problems for example setting min_free_kbytes value to below zero.

min_free_kbytes is limited to > 0 by the sysctl handler in kernel/sysctl.c

mh

--
Martin Hicks || [email protected] || PGP/GnuPG: 0x4C7F2BEE

Signature · 7 lines
Stay out of the road, if you want to grow old. 
~ Pink Floyd ~.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>