From: Andrew Morton <akpm@linux-foundation.org> To: Matthew Wilcox <willy@infradead.org> Cc: Wei Yongjun <weiyongjun1@huawei.com>, Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>, Waiman Long <longman@redhat.com>, Manfred Spraul <manfred@colorfullife.com>, Stephen Rothwell <sfr@canb.auug.org.au>, Alexey Dobriyan <adobriyan@gmail.com>, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH -next] ipc: use GFP_ATOMIC under spin lock Date: Tue, 28 Apr 2020 17:14:20 -0700 [thread overview] Message-ID: <20200428171420.045f0acc9e1bf20044c4560e@linux-foundation.org> (raw) In-Reply-To: <20200428111403.GJ29705@bombadil.infradead.org> On Tue, 28 Apr 2020 04:14:03 -0700 Matthew Wilcox <willy@infradead.org> wrote: > On Tue, Apr 28, 2020 at 03:47:36AM +0000, Wei Yongjun wrote: > > The function ipc_id_alloc() is called from ipc_addid(), in which > > a spin lock is held, so we should use GFP_ATOMIC instead. > > > > Fixes: de5738d1c364 ("ipc: convert ipcs_idr to XArray") > > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > > I see why you think that, but it's not true. Yes, we hold a spinlock, but > the spinlock is in an object which is not reachable from any other CPU. > So it's not possible to deadlock. um, then why are we taking it? > This probably confuses all kinds > of automated checkers, A big fat code comment would reduce the email traffic? > and I should probably rewrite the code to not > acquire the new spinlock until we're already holding the xa_lock. >
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org> To: Matthew Wilcox <willy@infradead.org> Cc: Wei Yongjun <weiyongjun1@huawei.com>, Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>, Waiman Long <longman@redhat.com>, Manfred Spraul <manfred@colorfullife.com>, Stephen Rothwell <sfr@canb.auug.org.au>, Alexey Dobriyan <adobriyan@gmail.com>, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH -next] ipc: use GFP_ATOMIC under spin lock Date: Wed, 29 Apr 2020 00:14:20 +0000 [thread overview] Message-ID: <20200428171420.045f0acc9e1bf20044c4560e@linux-foundation.org> (raw) In-Reply-To: <20200428111403.GJ29705@bombadil.infradead.org> On Tue, 28 Apr 2020 04:14:03 -0700 Matthew Wilcox <willy@infradead.org> wrote: > On Tue, Apr 28, 2020 at 03:47:36AM +0000, Wei Yongjun wrote: > > The function ipc_id_alloc() is called from ipc_addid(), in which > > a spin lock is held, so we should use GFP_ATOMIC instead. > > > > Fixes: de5738d1c364 ("ipc: convert ipcs_idr to XArray") > > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > > I see why you think that, but it's not true. Yes, we hold a spinlock, but > the spinlock is in an object which is not reachable from any other CPU. > So it's not possible to deadlock. um, then why are we taking it? > This probably confuses all kinds > of automated checkers, A big fat code comment would reduce the email traffic? > and I should probably rewrite the code to not > acquire the new spinlock until we're already holding the xa_lock. >
next prev parent reply other threads:[~2020-04-29 0:14 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-28 3:47 [PATCH -next] ipc: use GFP_ATOMIC under spin lock Wei Yongjun 2020-04-28 3:47 ` Wei Yongjun 2020-04-28 11:14 ` Matthew Wilcox 2020-04-28 11:14 ` Matthew Wilcox 2020-04-29 0:14 ` Andrew Morton [this message] 2020-04-29 0:14 ` Andrew Morton 2020-04-29 1:48 ` Matthew Wilcox 2020-04-29 1:48 ` Matthew Wilcox 2020-04-29 5:22 ` Manfred Spraul 2020-04-29 5:22 ` Manfred Spraul 2020-04-29 13:08 ` Matthew Wilcox 2020-04-29 13:08 ` Matthew Wilcox
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=20200428171420.045f0acc9e1bf20044c4560e@linux-foundation.org \ --to=akpm@linux-foundation.org \ --cc=adobriyan@gmail.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=longman@redhat.com \ --cc=manfred@colorfullife.com \ --cc=pankaj.laxminarayan.bharadiya@intel.com \ --cc=sfr@canb.auug.org.au \ --cc=weiyongjun1@huawei.com \ --cc=willy@infradead.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.