From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Michal Hocko <mhocko@kernel.org>
Cc: Wei Yongjun <weiyj.lk@gmail.com>,
jinqian@android.com, gregkh@linuxfoundation.org,
lstoakes@gmail.com, jack@suse.cz, christian.koenig@amd.com,
Wei Yongjun <weiyongjun1@huawei.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] goldfish_pipe: use GFP_ATOMIC under spin lock
Date: Mon, 22 May 2017 19:48:14 +0100 [thread overview]
Message-ID: <20170522194814.4681ef0b@alans-desktop> (raw)
In-Reply-To: <20170522115152.GH8509@dhcp22.suse.cz>
On Mon, 22 May 2017 13:51:52 +0200
Michal Hocko <mhocko@kernel.org> wrote:
> On Sun 21-05-17 09:48:36, Michal Hocko wrote:
> > On Sun 21-05-17 00:45:46, Wei Yongjun wrote:
> > > From: Wei Yongjun <weiyongjun1@huawei.com>
> > >
> > > The function get_free_pipe_id_locked() is called from
> > > goldfish_pipe_open() with a lock is held, so we should
> > > use GFP_ATOMIC instead of GFP_KERNEL.
> >
> > Why is GFP_NOWAIT insufficient? Does this path needs an access to memory
> > reserves?
>
> And now when looking at the code more deeply, wouldn't it be much better
> to simply do the allocation outside of the spin lock and do assignments
> with the lock held?
That's far from trivial and certainly for backporting and an immediate
fix this seems better. The allocations are not that large and any fail
would be in open() not anywhere weird.
Alan
next prev parent reply other threads:[~2017-05-22 18:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-21 0:45 [PATCH] goldfish_pipe: use GFP_ATOMIC under spin lock Wei Yongjun
2017-05-21 7:48 ` Michal Hocko
2017-05-22 11:51 ` Michal Hocko
2017-05-22 18:48 ` Alan Cox [this message]
2017-06-09 19:15 ` Jin Qian
2017-06-13 6:02 ` Greg Kroah-Hartman
2017-06-13 18:45 ` Jin Qian
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=20170522194814.4681ef0b@alans-desktop \
--to=gnomes@lxorguk.ukuu.org.uk \
--cc=christian.koenig@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=jinqian@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lstoakes@gmail.com \
--cc=mhocko@kernel.org \
--cc=weiyj.lk@gmail.com \
--cc=weiyongjun1@huawei.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