From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>
Subject: Re: error at compaction (Re: mmotm 2010-04-15-14-42 uploaded
Date: Tue, 20 Apr 2010 13:24:29 +0900 [thread overview]
Message-ID: <20100420132429.1049ca84.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <g2x28c262361004192058y64f4d316qcb1547909168e31f@mail.gmail.com>
On Tue, 20 Apr 2010 12:58:43 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:
> On Tue, Apr 20, 2010 at 12:07 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> > On Tue, 20 Apr 2010 11:39:46 +0900
> >> Dumb question. Why can't we call arch_alloc_page and kernel_map_pages
> >> as interrupt disabled? It's deadlock issue or latency issue?
> >> I don't found any comment about it.
> >> It should have added the comment around that functions. :)
> >>
> >
> > I guess it's from the same reason as vfree(), which can't be called under
> > irq-disabled.
> >
> > Both of them has to flush TLB of all cpus. At flushing TLB (of other cpus), cpus has
> > to send IPI via smp_call_function. What I know from old stories is below.
> >
> > At sendinf IPI, usual sequence is following. (This may be old.)
> >
> > spin_lock(&ipi_lock);
> > set up cpu mask for getting notification from other cpu for declearing
> > "I received IPI and finished my own work".
> > spin_unlock(&ipi_lock);
> >
> > Then,
> > CPU0 CPU1
> >
> > irq_disable (somewhere) spin_lock
> > send IPI and wait for notification.
> > spin_lock()
> >
> > deadlock. Seeing decription of kernel/smp.c::smp_call_function_many(), it says
> > this function should not be called under irq-disabled.
> > (Maybe the same kind of spin-wait deadlock can happen.)
> >
>
> Thanks for kind explanation.
> Actually I guessed TLB issue but I can't find any glue point which
> connect tlb flush to smp_call_function_xxx. :(
>
> Now look at the __native_flush_tlb_global.
> It just read and write cr4 with just mask off X86_CR4_PGE.
> So i don't know how connect this and smp_schedule_xxxx.
> Hmm,, maybe APIC?
>
> Sorry for dumb question.
>
Hmm...seeing again,
arch/x86/mm/pageattr.c::kernel_map_pages() says:
1293 /*
1294 * We should perform an IPI and flush all tlbs,
1295 * but that can deadlock->flush only current cpu:
1296 */
Wow. It just flush only local cpu. Then, no IPI.
Hmm...all other archs does the same thing ? If so, kernel_map_pages()
can be called under irq_disabled. The author of kernel_map_pages()
is aware that this can be called under irq-disabled.
Hmm...
Thanks,
-Kame
next prev parent reply other threads:[~2010-04-20 4:28 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 21:42 mmotm 2010-04-15-14-42 uploaded akpm
2010-04-15 23:38 ` [PATCH -mmotm] vmstat: fix build errors when PROC_FS is disabled Randy Dunlap
2010-04-16 16:03 ` mmotm 2010-04-15-14-42 uploaded (shmem, CGROUP_MEM_RES_CTLR) Randy Dunlap
2010-04-19 1:49 ` Daisuke Nishimura
2010-04-19 2:17 ` Randy Dunlap
2010-04-19 10:01 ` error at compaction (Re: mmotm 2010-04-15-14-42 uploaded KAMEZAWA Hiroyuki
2010-04-19 18:14 ` Mel Gorman
2010-04-19 19:39 ` Mel Gorman
2010-04-20 2:30 ` KAMEZAWA Hiroyuki
2010-04-20 2:39 ` Minchan Kim
2010-04-20 3:07 ` KAMEZAWA Hiroyuki
2010-04-20 3:58 ` Minchan Kim
2010-04-20 4:24 ` KAMEZAWA Hiroyuki [this message]
2010-04-20 8:20 ` Mel Gorman
2010-04-20 8:32 ` Minchan Kim
2010-04-20 8:44 ` Mel Gorman
2010-04-20 9:50 ` Minchan Kim
2010-04-20 9:58 ` Mel Gorman
2010-04-20 10:14 ` Minchan Kim
2010-04-21 8:28 ` KAMEZAWA Hiroyuki
2010-04-21 9:48 ` KAMEZAWA Hiroyuki
2010-04-21 10:20 ` Mel Gorman
2010-04-21 16:52 ` Minchan Kim
2010-04-21 23:01 ` Minchan Kim
2010-04-20 2:35 ` KAMEZAWA Hiroyuki
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=20100420132429.1049ca84.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.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;
as well as URLs for NNTP newsgroup(s).