mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Paul Jackson <pj@sgi.com>
Cc: Andrew Morton <akpm@osdl.org>, Brent Casavant <bcasavan@sgi.com>,
	Andi Kleen <ak@suse.de>, Anton Blanchard <anton@samba.org>,
	linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>
Subject: Re: more numa maxnode confusions
Date: Mon, 13 Sep 2004 08:56:21 +0200	[thread overview]
Message-ID: <20040913065621.GB12185@wotan.suse.de> (raw)
In-Reply-To: <20040912200253.3d7a6ff5.pj@sgi.com>

On Sun, Sep 12, 2004 at 08:02:53PM -0700, Paul Jackson wrote:
>  2) About Aug 9, Brent Casavant sent in a patch changing the set (not get)
>     side calls, sys_mbind and sys_set_mempolicy, to N64.  This patch
>     removed the following line from the implementation of get_nodes() in
>     mm/mempolicy.c:
> 
> 	--maxnode;

Ah, I wasn't aware that this patch got merged into mainline. 
That was a bad thing, because it broke the ABI used by libnuma
subtly.

Please whoever merged it revert it.

> Currently, by my reading, Linus' bk tree has the mixed N64/N65
> interfaces, since it has Brent's patch, but not my cpuset patch.
> Andrew's *-mm tree has the pure N65 interface, due to my cpuset patch
> reversing Brent's patch.
> 
> My guess is that Andi wants this all N65, and that he didn't agree to
> Brent's patch.  If Andi understands different, that's fine -- I'm not
> trying to reopen that battle.

Correct.


> 
> Andi:
> 
>  0) Are my above statements anywhere close to correct?

Yes.

> 
>  1) Should the "--maxnode" be re-inserted in get_nodes()?

Yes.

> 
>  2) Should it be re-inserted by a separate patch from you,
>     rather than as a hidden side affect of my cpuset patch?
>     I will gladly remove that line from my cpuset patch, in
>     favor of a one-liner from you that re-inserts that line.

Yes. I appended a patch. Linus or Andrew, please apply it.

Thanks for catching this.

-Andi


----------------------------------------------------------------

Fix ABI in set_mempolicy() that got broken by an earlier change.

Add a check for very big input values and prevent excessive
looping in the kernel.


diff -u linux-2.6.9rc1-bk19/mm/mempolicy.c-o linux-2.6.9rc1-bk19/mm/mempolicy.c
--- linux-2.6.9rc1-bk19/mm/mempolicy.c-o	2004-09-13 08:51:46.000000000 +0200
+++ linux-2.6.9rc1-bk19/mm/mempolicy.c	2004-09-13 08:53:58.000000000 +0200
@@ -132,6 +132,7 @@
 	unsigned long nlongs;
 	unsigned long endmask;
 
+	--maxnode;
 	bitmap_zero(nodes, MAX_NUMNODES);
 	if (maxnode == 0 || !nmask)
 		return 0;
@@ -145,6 +146,8 @@
 	/* When the user specified more nodes than supported just check
 	   if the non supported part is all zero. */
 	if (nlongs > BITS_TO_LONGS(MAX_NUMNODES)) {
+		if (nlongs > PAGE_SIZE/sizeof(long))
+			return -EINVAL;
 		for (k = BITS_TO_LONGS(MAX_NUMNODES); k < nlongs; k++) {
 			unsigned long t;
 			if (get_user(t,  nmask + k))






  reply	other threads:[~2004-09-13  6:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-13  3:02 Paul Jackson
2004-09-13  6:56 ` Andi Kleen [this message]
2004-09-13  7:08   ` Paul Jackson
2004-09-13  7:15   ` Andrew Morton
2004-09-13  7:23     ` Andi Kleen
2004-09-13  8:46     ` Paul Jackson
2004-09-13 12:58       ` [PATCH] undo " Paul Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040913065621.GB12185@wotan.suse.de \
    --to=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=bcasavan@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pj@sgi.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®