From: Andrew Morton <akpm@linux-foundation.org>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mike Galbraith <efault@gmx.de>,
Oleg Nesterov <onestero@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [resend][PATCH v2] mlock() doesn't wait to finish lru_add_drain_all()
Date: Mon, 12 Oct 2009 20:35:55 -0700 [thread overview]
Message-ID: <20091012203555.405bd9e7.akpm@linux-foundation.org> (raw)
In-Reply-To: <20091013110409.C758.A69D9226@jp.fujitsu.com>
On Tue, 13 Oct 2009 12:18:17 +0900 (JST) KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> The problem is in __lru_cache_add().
>
> ============================================================
> void __lru_cache_add(struct page *page, enum lru_list lru)
> {
> struct pagevec *pvec = &get_cpu_var(lru_add_pvecs)[lru];
>
> page_cache_get(page);
> if (!pagevec_add(pvec, page))
> ____pagevec_lru_add(pvec, lru);
> put_cpu_var(lru_add_pvecs);
> }
> ============================================================
>
> current typical scenario is
> 1. preempt disable
> 2. assign lru_add_pvec
> 3. page_cache_get()
> 4. pvec->pages[pvec->nr++] = page;
> 5. preempt enable
>
> but the preempt disabling assume drain_cpu_pagevecs() run on process context.
> we need to convert it with irq_disabling.
Nope, preempt_disable()/enable() can be performed in hard IRQ context.
I see nothing in __lru_cache_add() which would cause problems when run
from hard IRQ.
Apart from latency, of course. Doing a full smp_call_function() in
lru_add_drain_all() might get expensive if it's ever called with any
great frequency.
A smart implementation might take a peek at other cpu's queues and omit
the cross-CPU call if the queue is empty, for example..
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-10-13 3:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 2:21 [resend][PATCH v2] mlock() doesn't wait to finish lru_add_drain_all() KOSAKI Motohiro
2009-10-12 23:57 ` Andrew Morton
2009-10-13 1:17 ` KOSAKI Motohiro
2009-10-13 1:51 ` Andrew Morton
2009-10-13 3:18 ` KOSAKI Motohiro
2009-10-13 3:35 ` Andrew Morton [this message]
2009-10-13 4:25 ` Valdis.Kletnieks
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=20091012203555.405bd9e7.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=a.p.zijlstra@chello.nl \
--cc=efault@gmx.de \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=onestero@redhat.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).