From: Ming Lei <ming.lei@canonical.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-kernel@vger.kernel.org,
Alan Stern <stern@rowland.harvard.edu>,
Oliver Neukum <oneukum@suse.de>, Minchan Kim <minchan@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [RFC PATCH v1 2/3] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack
Date: Fri, 19 Oct 2012 09:41:27 +0800 [thread overview]
Message-ID: <CACVXFVMBSzPiY_kRd75wPJMVb4YFQeVAnWDVyz6ua7OFsMBSTw@mail.gmail.com> (raw)
In-Reply-To: <11374134.vToUn932b7@vostro.rjw.lan>
On Fri, Oct 19, 2012 at 7:16 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>
> Well, the question is how many runtime resume callbacks actually allocate
> memory. If they are not too many, we can just flag all of them. Otherwise,
At least, almost all pci devices driver in some platform(acpi) and all usb
devices driver allocate memory with GFP_KERNEL which is done in
subsystem, see below:
http://marc.info/?l=linux-kernel&m=135044522501229&w=2
I also found that many usb interface drivers(usblp, uvc, gspca, most of
dvb-usb-v2 media drivers, cpia2, az6007, ....) will do it too.
It is not good to convert all these GFP_KERNEL into GFP_NOIO
because the function doing that will be called in many other contexts.
That is just what I have found. Unfortunately, this allocation can only be
found by human being now, maybe there are many not found since
any function in the resume path(call tree) may allocate memory with
GFP_KERNEL.
In fact, memalloc_noio() can convert some of current static GFP_NOIO
allocation into GFP_KERNEL in other contexts, at least almost all
GFP_NOIO in USB subsystem can be converted into GFP_KERNEL
after applying the approach and make allocation with GFP_IO
only happen in runtime resume/bus reset/block I/O transfer contexts
generally.
> adding a flag may be a better approach. I'm not sure ATM.
OK, I will prepare -v2 with the flag approach for review.
Thanks,
--
Ming Lei
next prev parent reply other threads:[~2012-10-19 1:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 15:59 [RFC PATCH v1 0/3] mm/PM/USB: memory allocation with no io in need Ming Lei
2012-10-16 15:59 ` [RFC PATCH v1 1/3] mm: teach mm by current context info to not do I/O during memory allocation Ming Lei
2012-10-16 20:19 ` Andrew Morton
2012-10-17 1:54 ` Ming Lei
2012-10-17 23:54 ` Andrew Morton
2012-10-19 3:52 ` Ming Lei
2012-10-17 3:40 ` Ming Lei
2012-10-17 5:14 ` Kamezawa Hiroyuki
2012-10-17 10:56 ` Ming Lei
2012-10-16 15:59 ` [RFC PATCH v1 2/3] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack Ming Lei
2012-10-17 5:43 ` Rafael J. Wysocki
2012-10-17 11:07 ` Ming Lei
2012-10-18 23:16 ` Rafael J. Wysocki
2012-10-19 1:41 ` Ming Lei [this message]
2012-10-16 15:59 ` [RFC PATCH v1 3/3] USB: forbid memory allocation with I/O during bus reset Ming Lei
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=CACVXFVMBSzPiY_kRd75wPJMVb4YFQeVAnWDVyz6ua7OFsMBSTw@mail.gmail.com \
--to=ming.lei@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=oneukum@suse.de \
--cc=rjw@sisk.pl \
--cc=stern@rowland.harvard.edu \
/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).