From: duoming@zju.edu.cn
To: "Greg KH" <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
briannorris@chromium.org, amitkarwar@gmail.com,
ganapathi017@gmail.com, sharvari.harisangam@nxp.com,
huxinming820@gmail.com, kvalo@kernel.org, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, johannes@sipsolutions.net,
rafael@kernel.org
Subject: Re: [PATCH v7 1/2] devcoredump: remove the useless gfp_t parameter in dev_coredumpv and dev_coredumpm
Date: Thu, 18 Aug 2022 23:46:39 +0800 (GMT+08:00) [thread overview]
Message-ID: <5108e03b.8c156.182b1a2973f.Coremail.duoming@zju.edu.cn> (raw)
In-Reply-To: <Yv5TefZcrUPY1Qjc@kroah.com>
Hello,
On Thu, 18 Aug 2022 16:58:01 +0200 Greg KH wrote:
> On Wed, Aug 17, 2022 at 10:05:37PM +0800, duoming@zju.edu.cn wrote:
> > Hello,
> >
> > On Wed, 17 Aug 2022 14:43:29 +0200 Greg KH wrote:
> >
> > > On Wed, Aug 17, 2022 at 08:39:12PM +0800, Duoming Zhou wrote:
> > > > The dev_coredumpv() and dev_coredumpm() could not be used in atomic
> > > > context, because they call kvasprintf_const() and kstrdup() with
> > > > GFP_KERNEL parameter. The process is shown below:
> > > >
> > > > dev_coredumpv(.., gfp_t gfp)
> > > > dev_coredumpm(.., gfp_t gfp)
> > > > dev_set_name
> > > > kobject_set_name_vargs
> > > > kvasprintf_const(GFP_KERNEL, ...); //may sleep
> > > > kstrdup(s, GFP_KERNEL); //may sleep
> > > >
> > > > This patch removes gfp_t parameter of dev_coredumpv() and dev_coredumpm()
> > > > and changes the gfp_t parameter of kzalloc() in dev_coredumpm() to
> > > > GFP_KERNEL in order to show they could not be used in atomic context.
> > > >
> > > > Fixes: 833c95456a70 ("device coredump: add new device coredump class")
> > > > Reviewed-by: Brian Norris <briannorris@chromium.org>
> > > > Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> > > > Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
> > > > ---
> > > > Changes in v7:
> > > > - Remove gfp_t flag in amdgpu device.
> > >
> > > Again, this creates a "flag day" where we have to be sure we hit all
> > > users of this api at the exact same time. This will prevent any new
> > > driver that comes into a maintainer tree during the next 3 months from
> > > ever being able to use this api without cauing build breakages in the
> > > linux-next tree.
> > >
> > > Please evolve this api to work properly for everyone at the same time,
> > > like was previously asked for so that we can take this change. It will
> > > take 2 releases, but that's fine.
> >
> > Thank you for your reply, I will evolve this api to work properly for everyone.
> > If there are not any new drivers that use this api during the next 3 months,
> > I will send this patch again. Otherwise, I will wait until there are not new
> > users anymore.
>
> No, that is not necessary. Do the work now so that there is no flag day
> and you don't have to worry about new users, it will all "just work".
Do you mean we should replace dev_set_name() in dev_coredumpm() to some other
functions that could work both in interrupt context and process context?
Best regards,
Duoming Zhou
next prev parent reply other threads:[~2022-08-18 15:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 12:39 [PATCH v7 0/2] Remove useless param of devcoredump functions and fix bugs Duoming Zhou
2022-08-17 12:39 ` [PATCH v7 1/2] devcoredump: remove the useless gfp_t parameter in dev_coredumpv and dev_coredumpm Duoming Zhou
2022-08-17 12:43 ` Greg KH
2022-08-17 14:05 ` duoming
2022-08-18 14:58 ` Greg KH
2022-08-18 15:46 ` duoming [this message]
2022-08-22 18:21 ` Brian Norris
2022-08-23 11:26 ` duoming
2022-08-17 12:39 ` [PATCH v7 2/2 RESEND] mwifiex: fix sleep in atomic context bugs caused by dev_coredumpv Duoming Zhou
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=5108e03b.8c156.182b1a2973f.Coremail.duoming@zju.edu.cn \
--to=duoming@zju.edu.cn \
--cc=amitkarwar@gmail.com \
--cc=briannorris@chromium.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ganapathi017@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=huxinming820@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafael@kernel.org \
--cc=sharvari.harisangam@nxp.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).