public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH for-3.3] mempool: clean up and document synchronization and memory barrier usage
Date: Wed, 21 Dec 2011 15:57:14 +0100	[thread overview]
Message-ID: <20111221145714.GB25657@redhat.com> (raw)
In-Reply-To: <20111221145556.GA25657@redhat.com>

On 12/21, Oleg Nesterov wrote:
>
> On 12/20, Tejun Heo wrote:
> >
> > Furthermore, mempool_alloc() is already holding pool->lock when it
> > decides that it needs to wait.  There is no reason to do unlock - add
> > waitqueue - test condition again.  It can simply add itself to
> > waitqueue while holding pool->lock and then unlock and sleep.
>
> Confused. I agree, we can hold pool->lock until schedule(). But, at
> the same time, why should we hold it?

Ah, I see.

> Or I missed the reason why we must not unlock before prepare_to_wait?

I didn't notice that this removes another "if (!pool->curr_nr)" check.

Oleg.


  reply	other threads:[~2011-12-21 15:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 22:18 [PATCH for-3.3] mempool: clean up and document synchronization and memory barrier usage Tejun Heo
2011-12-21 14:55 ` Oleg Nesterov
2011-12-21 14:57   ` Oleg Nesterov [this message]
2011-12-21 16:37   ` Tejun Heo
2011-12-21 16:44     ` Tejun Heo
2011-12-21 17:40     ` Oleg Nesterov
2011-12-21 18:52       ` Tejun Heo
2011-12-21 15:12 ` mempool && io_schedule_timeout() Oleg Nesterov
2011-12-21 15:34   ` Tejun Heo
2011-12-21 19:08 ` [PATCH for-3.3 UPDATED] mempool: fix and document synchronization and memory barrier usage Tejun Heo

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=20111221145714.GB25657@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.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