mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Allow a larger buffer for writes to cpuset files
@ 2006-10-31  2:38 Paul Menage
  2006-10-31  4:00 ` Paul Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Menage @ 2006-10-31  2:38 UTC (permalink / raw)
  To: Andrew Morton, Paul Jackson; +Cc: linux-kernel

When using fake NUMA setup, the number of memory nodes can greatly
exceed the number of CPUs. So the current limit in
cpuset_common_file_write() is insufficient. PAGE_SIZE is still a bit
of an arbitrary limit, but gives more breathing room.

Signed-off-by: Paul Menage <menage@google.com>

--- 2.6.19-rc2.orig/kernel/cpuset.c
+++ 2.6.19-rc2/kernel/cpuset.c
@@ -1292,7 +1292,7 @@ static ssize_t cpuset_common_file_write(
 	int retval = 0;

 	/* Crude upper limit on largest legitimate cpulist user might write. */
-	if (nbytes > 100 + 6 * NR_CPUS)
+	if (nbytes >= PAGE_SIZE)
 		return -E2BIG;

 	/* +1 for nul-terminator */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Allow a larger buffer for writes to cpuset files
  2006-10-31  2:38 [PATCH] Allow a larger buffer for writes to cpuset files Paul Menage
@ 2006-10-31  4:00 ` Paul Jackson
  2006-10-31  4:15   ` Paul Menage
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Jackson @ 2006-10-31  4:00 UTC (permalink / raw)
  To: Paul Menage; +Cc: akpm, linux-kernel

Paul M wrote:
> @@ -1292,7 +1292,7 @@ static ssize_t cpuset_common_file_write(
>  	int retval = 0;
> 
>  	/* Crude upper limit on largest legitimate cpulist user might write. */
> -	if (nbytes > 100 + 6 * NR_CPUS)
> +	if (nbytes >= PAGE_SIZE)

On a system with 4 Kbyte pages, this imposes a tighter limit
if NR_CPUS is > 666.

On a system with 16 Kbyte pages, this imposes a tighter limit
if NR_CPUS is > 2714.

Those CPU counts don't look that futuristic to me.

And it makes the limit more aribitrary ... like what the heck does
that check have to do with PAGE_SIZE ?

How about coding for the possibility that either NR_CPUS or MAX_NUMNODES
is larger, and removing 'cpu' from the comment:

	/* Crude upper limit on largest legitimate list user might write. */
	if (nbytes > 100 + 6 * max(NR_CPUS, MAX_NUMNODES))

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Allow a larger buffer for writes to cpuset files
  2006-10-31  4:00 ` Paul Jackson
@ 2006-10-31  4:15   ` Paul Menage
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Menage @ 2006-10-31  4:15 UTC (permalink / raw)
  To: Paul Jackson; +Cc: akpm, linux-kernel

On 10/30/06, Paul Jackson <pj@sgi.com> wrote:
>
> How about coding for the possibility that either NR_CPUS or MAX_NUMNODES
> is larger, and removing 'cpu' from the comment:
>
>         /* Crude upper limit on largest legitimate list user might write. */
>         if (nbytes > 100 + 6 * max(NR_CPUS, MAX_NUMNODES))
>

Yes, that does seem like a better idea.

Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-31  4:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-31  2:38 [PATCH] Allow a larger buffer for writes to cpuset files Paul Menage
2006-10-31  4:00 ` Paul Jackson
2006-10-31  4:15   ` Paul Menage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®