lkml.org 
[lkml]   [2012]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v1 2/3] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack
From
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


\
 
 \ /
  Last update: 2012-10-19 04:21    [W:1.002 / U:1.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site