From: Kanoj Sarcar <kanojsarcar@yahoo.com>
To: colpatch@us.ibm.com, Andrew Morton <akpm@zip.com.au>,
Martin Bligh <mjbligh@us.ibm.com>,
linux-mm@kvack.org, Michael Hohnbaum <hohnbaum@us.ibm.com>
Subject: Re: [patch] Useless locking in mm/numa.c
Date: Fri, 19 Jul 2002 11:36:46 -0700 (PDT) [thread overview]
Message-ID: <20020719183646.32486.qmail@web14310.mail.yahoo.com> (raw)
In-Reply-To: <3D376567.4040307@us.ibm.com>
I think I put in the locks in the initial version of
the file becase the idea was that
show_free_areas_node() could be invoked from any cpu
in a multinode system (via the sysrq keys or other
intr sources), and the spin lock would provide
sanity in the print out.
For nonnuma discontig machines, isn't the spin lock
providing protection in the pgdat list chain walking
in _alloc_pages()?
Kanoj
--- Matthew Dobson <colpatch@us.ibm.com> wrote:
> There is a lock that is apparently protecting
> nothing. The node_lock spinlock
> in mm/numa.c is protecting read-only accesses to
> pgdat_list. Here is a patch
> to get rid of it.
>
> Cheers!
>
> -Matt
> > --- linux-2.5.26-vanilla/mm/numa.c Tue Jul 16
> 16:49:30 2002
> +++ linux-2.5.26-vanilla/mm/numa.c.fixed Thu Jul 18
> 17:59:35 2002
> @@ -44,15 +44,11 @@
>
> #define LONG_ALIGN(x)
> (((x)+(sizeof(long))-1)&~((sizeof(long))-1))
>
> -static spinlock_t node_lock = SPIN_LOCK_UNLOCKED;
> -
> void show_free_areas_node(pg_data_t *pgdat)
> {
> unsigned long flags;
>
> - spin_lock_irqsave(&node_lock, flags);
> show_free_areas_core(pgdat);
> - spin_unlock_irqrestore(&node_lock, flags);
> }
>
> /*
> @@ -106,11 +102,9 @@
> #ifdef CONFIG_NUMA
> temp = NODE_DATA(numa_node_id());
> #else
> - spin_lock_irqsave(&node_lock, flags);
> if (!next) next = pgdat_list;
> temp = next;
> next = next->node_next;
> - spin_unlock_irqrestore(&node_lock, flags);
> #endif
> start = temp;
> while (temp) {
>
__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/
next prev parent reply other threads:[~2002-07-19 18:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-19 1:03 Matthew Dobson
2002-07-19 18:36 ` Kanoj Sarcar [this message]
2002-07-19 18:38 ` William Lee Irwin III
2002-07-19 18:40 ` Kanoj Sarcar
2002-07-19 20:30 ` Matthew Dobson
2002-07-19 21:45 ` Matthew Dobson
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=20020719183646.32486.qmail@web14310.mail.yahoo.com \
--to=kanojsarcar@yahoo.com \
--cc=akpm@zip.com.au \
--cc=colpatch@us.ibm.com \
--cc=hohnbaum@us.ibm.com \
--cc=linux-mm@kvack.org \
--cc=mjbligh@us.ibm.com \
/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