[PATCH v3 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-10-29 Thread Ming Lei
n Cc: KAMEZAWA Hiroyuki Cc: Michal Hocko Cc: Ingo Molnar Cc: Peter Zijlstra Cc: "Rafael J. Wysocki" Signed-off-by: Minchan Kim Signed-off-by: Ming Lei --- v3: - no change v2: - remove changes on 'may_writepage' and 'may_swap' because that

[PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-29 Thread Ming Lei
d in block device's error handling path (for example, usb device reset) Cc: Alan Stern Cc: "Rafael J. Wysocki" Signed-off-by: Ming Lei --- v3: - introduce pm_runtime_get_memalloc_noio() - hold one global lock on pm_runtime_set_memalloc_noio - hold device

[PATCH v3 3/6] block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices

2012-10-29 Thread Ming Lei
This patch applyes the introduced pm_runtime_set_memalloc_noio on block device so that PM core will teach mm to not allocate memory with GFP_IOFS when calling the runtime_resume callback for block devices. Cc: Jens Axboe Signed-off-by: Ming Lei --- block/genhd.c |8 1 file changed

[PATCH v3 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices

2012-10-29 Thread Ming Lei
c Dumazet Cc: David Decotigny Cc: Tom Herbert Cc: Ingo Molnar Signed-off-by: Ming Lei --- net/core/net-sysfs.c |5 + 1 file changed, 5 insertions(+) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index bcf02f6..9aba5be 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sy

[PATCH v3 5/6] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack

2012-10-29 Thread Ming Lei
This patch applies the introduced memalloc_noio_save() and memalloc_noio_restore() to force memory allocation with no I/O during runtime_resume callback on device which is marked as memalloc_noio_resume. Cc: Alan Stern Cc: Oliver Neukum Cc: Rafael J. Wysocki Signed-off-by: Ming Lei

[PATCH v3 6/6] USB: forbid memory allocation with I/O during bus reset

2012-10-29 Thread Ming Lei
set() and the storage interface can't do I/O transfer when the reset is triggered by other interface, or the error handling can't be completed if the reset is triggered by the storage itself(error handling path). Cc: Alan Stern Cc: Oliver Neukum Signed-off-by: Ming Lei --- v3: - che

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-29 Thread Ming Lei
On Mon, Oct 29, 2012 at 11:41 PM, Alan Stern wrote: > On Mon, 29 Oct 2012, Ming Lei wrote: > >> The patch introduces the flag of memalloc_noio_resume in >> 'struct dev_pm_info' to help PM core to teach mm not allocating >> memory with GFP_KERNEL flag for avo

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
n add the disk into device model via register_disk(), the solution should be fine. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-inf

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
during > usb_reset_device even when there's no runtime PM. Maybe the simplest > answer is always to set noio during resets. That would also help with > the race described above. I have thought about this. IMO, pm_runtime_get_memalloc_noio should return true always if CONFIG_PM_RUNT

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
On Wed, Oct 31, 2012 at 12:00 AM, Ming Lei wrote: > > Looks the simplest approach is to handle the noio flag thing at the start and > end of rpm_resume. Sorry, that doesn't work, runtime_suspend need that too because memory allocation with block I/O might deadlock when doing I

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
x27;root_wait' problem, see prepare_namespace(): init/do_mounts.c, so looks no good solution for the problem, and maybe we have to set the flag always before resetting usb device. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-30 Thread Ming Lei
On Wed, Oct 31, 2012 at 10:08 AM, Ming Lei wrote: >> I am afraid it is, because a disk may just have been probed as the deviceis >> being reset. > > Yes, it is probable, and sounds like similar with 'root_wait' problem, see > prepare_namespace(): init/do_mounts.c,

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-06 Thread Ming Lei
ot;MAC address read from > DTB\n"); > + return; > + } > + } > +#endif > + > /* try reading mac address from EEPROM */ > if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, > dev->net-

Re: dell_rbu: Select CONFIG_FW_LOADER_USER_HELPER explicitly

2013-07-08 Thread Ming Lei
lready and it is very easy to trigger build problem, and introduce extra complexity to users at the same time. About Dave's problem, I think distribution may not trigger it since cpu microcode should exist, so I am wondering if Dave can disable DELL_RBU to work around the problem in his s

Re: dell_rbu: Select CONFIG_FW_LOADER_USER_HELPER explicitly

2013-07-09 Thread Ming Lei
On Tue, Jul 9, 2013 at 1:33 PM, Takashi Iwai wrote: > At Tue, 9 Jul 2013 11:15:20 +0800, > Ming Lei wrote: >> >> On Mon, Jul 8, 2013 at 5:05 PM, Takashi Iwai wrote: >> > At Sat, 6 Jul 2013 15:30:03 -0700, >> > Greg KH wrote: >> >> >> >>

Re: dell_rbu: Select CONFIG_FW_LOADER_USER_HELPER explicitly

2013-07-09 Thread Ming Lei
h means the user helper code has to be compiled in. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: dell_rbu: Select CONFIG_FW_LOADER_USER_HELPER explicitly

2013-07-09 Thread Ming Lei
On Tue, Jul 9, 2013 at 10:45 PM, Takashi Iwai wrote: > At Tue, 9 Jul 2013 22:39:36 +0800, > Ming Lei wrote: >> >> On Tue, Jul 9, 2013 at 9:32 PM, Takashi Iwai wrote: >> > At Tue, 9 Jul 2013 16:43:30 +0800, >> >> Actually from view of distribution, dell r

Re: dell_rbu: Select CONFIG_FW_LOADER_USER_HELPER explicitly

2013-07-09 Thread Ming Lei
ks the description in help doc isn't consistent with what you wanted, :-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: BUG: key ffff880c1148c478 not in .data! (V3.10.0)

2013-07-11 Thread Ming Lei
d/0x40 > [4.525567] [] __mutex_init+0x51/0x60 > [4.531017] [] bus_register+0x158/0x2c0 > [4.536646] [] edac_create_sysfs_mci_device+0x53/0x540 Looks because that bus_type of 'struct mem_ctl_info' is allocated dynamically instead of being kept it in .data statically. Thanks, -- Ming Lei --

Re: [PATCH] firmware: Be a bit more verbose about direct firmware loading failure

2013-09-11 Thread Ming Lei
s we didn't meet this case, do you have real examples? > > Signed-off-by: Neil Horman > CC: Ming Lei > CC: Greg Kroah-Hartman > --- > drivers/base/firmware_class.c | 38 +- > 1 file changed, 25 insertions(+), 13 deletions(-) &

Re: [PATCH] firmware: Be a bit more verbose about direct firmware loading failure

2013-09-11 Thread Ming Lei
On Wed, Sep 11, 2013 at 10:19 PM, Neil Horman wrote: > On Wed, Sep 11, 2013 at 07:54:28PM +0800, Ming Lei wrote: >> On Sat, Sep 7, 2013 at 3:36 AM, Neil Horman wrote: >> > The direct firmware loading interface is a bit quiet about failures. >> > Failures >>

Re: [PATCH] firmware: Be a bit more verbose about direct firmware loading failure

2013-09-12 Thread Ming Lei
the filp_open on a firmware > file > fails, we continue the for loop through the list of available search paths. > No > error is generated in the case you describe above. You are right, sorry for missing "if (IS_ERR(file)) continue;", and looks the patch is good. Acked-by

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-07 Thread Ming Lei
On Mon, Oct 7, 2013 at 1:31 AM, Dan Murphy wrote: > On 10/06/2013 10:05 AM, Ming Lei wrote: >> On Sat, Oct 5, 2013 at 2:25 AM, Dan Murphy wrote: >>> If the smsc95xx does not have a valid MAC address stored within >>> the eeprom then a random number is generated. The

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-10 Thread Ming Lei
ode. > > I will need to post V2 for that. Your patch still doesn't deal with two smsc95xx devices built in one board. The problem is a generic one, looks it is better to do it when OF supports discoverable bus. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line &quo

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-10 Thread Ming Lei
iscussions first before post your V2. Below link is one I remembered, but I think you can find more: https://lkml.org/lkml/2013/8/11/100 > This is all dependent on what the dev.id is of udev. I am not sure why it depends on udev, and udev can't see the device util it is added to system. Th

Re: [PATCH] firmware loader: fix pending_fw_head list corruption

2013-08-30 Thread Ming Lei
nt, > kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD); > } > > - mutex_lock(&fw_lock); > - list_add(&buf->pending_list, &pending_fw_head); > - mutex_unlock(&fw_lock); > - > wait_for_completion(&buf->c

Re: [PATCH] driver core : Fix use after free of dev->parent in device_shutdown

2013-09-24 Thread Ming Lei
} > > device_unlock(dev); > - if (dev->parent) > - device_unlock(dev->parent); > + if (parent) > + device_unlock(parent); > > put_device(dev); > - put_device(d

Re: A workaround for request_firmware() stuck in module_init

2012-09-05 Thread Ming Lei
uch faster to fix existing drivers and much > harder for a random device driver to get it wrong. We can even add > helpers which manage dev->firmware, and free the relevant objects when > needed, plus doing automatic ref/deref on probe/remove so that for a As said above, ref/deref on p

Re: A workaround for request_firmware() stuck in module_init

2012-09-05 Thread Ming Lei
e other big value apart from making it harder for driver writers to > screw up is that it takes some of the control and puts it in one place. > That means you can change it later easily not in each driver. > > This is enabling for device drivers. With no intention of offending > driv

Re: A workaround for request_firmware() stuck in module_init

2012-09-06 Thread Ming Lei
t; it should be devm_request_firmware() and use the mechanism we have ? IMO, the kind of devm_request_firmware() mechanism may have its disadvantage because the firmware in memory may or should be released just after it has been downloaded into device, otherwise it will consume memory unnecessarily to kee

Re: [RFC PATCH v1 12/15] firmware: introduce device_cache/uncache_fw_images

2012-09-06 Thread Ming Lei
On Fri, Sep 7, 2012 at 6:44 AM, Andrew Morton wrote: > On Sat, 4 Aug 2012 12:01:27 +0800 > Ming Lei wrote: > >> This patch introduces the three helpers below: >> >> void device_cache_fw_images(void) >> void device_uncache_fw_images(void) >>

[PATCH] firmware loader: fix compile warning when CONFIG_PM=n

2012-09-08 Thread Ming Lei
defined but not used drivers/base/firmware_class.c:1212: warning: 'device_uncache_fw_images_delay' defined but not used Reported-by: Andrew Morton Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 33 ++--- 1 file changed,

Re: [RFC PATCH v1 12/15] firmware: introduce device_cache/uncache_fw_images

2012-09-08 Thread Ming Lei
On Fri, Sep 7, 2012 at 11:16 PM, Greg Kroah-Hartman wrote: > Can you send it to me in a format that I can apply it in? OK, sent out, :-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.ke

[RFC PATCH 0/5] driver core: driver probe asynchronously

2012-09-08 Thread Ming Lei
Hi, This patchset implements asynchronous driver probe for driver_register, and try to address the below problems about driver init during kernel boot: - help to solve some dependency problem during kernel boot (such as, request_firmware is called inside probe when driver i

[RFC PATCH 5/5] driver core: implement asynchorous probe() inside driver_register

2012-09-08 Thread Ming Lei
Signed-off-by: Ming Lei --- drivers/base/driver.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 9365076..67fb63c 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -15,6 +15,7

[RFC PATCH 1/5] driver core: driver probe at the last minute in driver_register

2012-09-08 Thread Ming Lei
It should be correct to probe driver at the last minute in driver_register since it will be so in !auto_probe case and driver_register on no matched devices case. Signed-off-by: Ming Lei --- drivers/base/bus.c|5 - drivers/base/driver.c |4 2 files changed, 4 insertions

[RFC PATCH 2/5] driver core: introduce driver_register_sync helper

2012-09-08 Thread Ming Lei
This patch introduces driver_register_sync helper to make driver's probe called synchronously inside driver_register path. platform_driver_probe should use driver_register_sync. Signed-off-by: Ming Lei --- drivers/base/driver.c |5 +++-- include/linux/device.h | 13 +++

[RFC PATCH 3/5] driver core: platform: apply driver_register_sync for platform_driver_probe

2012-09-08 Thread Ming Lei
platform_driver_probe supposes that the driver's probe is always called inside platform_driver_probe, so apply driver_register_sync for it. Signed-off-by: Ming Lei --- drivers/base/platform.c | 11 +++ include/linux/platform_device.h | 12 +++- 2 files change

[RFC PATCH 4/5] driver core: remove __must_check on declaration of driver_attach

2012-09-08 Thread Ming Lei
The check is not necessary since driver_attach should return 0 always. Signed-off-by: Ming Lei --- include/linux/device.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index 7222c0b..dbb5efd 100644 --- a/include/linux

Re: [RFC PATCH 0/5] driver core: driver probe asynchronously

2012-09-09 Thread Ming Lei
On Sun, Sep 9, 2012 at 10:57 AM, Greg Kroah-Hartman wrote: > On Sun, Sep 09, 2012 at 07:25:15AM +0800, Ming Lei wrote: >> Hi, >> >> This patchset implements asynchronous driver probe for driver_register, >> and try to address the below problems about driver

Re: [PATCH] firmware: Don't attempt to allocate zero bytes with vmalloc()

2012-10-08 Thread Ming Lei
r *buf; > > size = fw_file_size(file); > + if (size == 0) { > + fw->data = NULL; > + fw->size = 0; > + return true; > + } Considered that zero-length firmware image doesn't make sense for drivers (callers),

[PATCH 0/4] firmware loader: misc changes

2012-10-08 Thread Ming Lei
Hi, The first two are fixes' patch, the 3rd one is to enable caching firmware for direct loading, and the last one is a cleanup patch. drivers/base/firmware_class.c | 266 +++-- 1 file changed, 151 insertions(+), 115 deletions(-) Thanks, -- Min

[PATCH 1/4] firmware loader: cancel uncache work before caching firmware

2012-10-08 Thread Ming Lei
imizes the cacheing firmware mechanism a bit by only storing one firmware cache entry for one firmware image. So if the firmware is still cached during suspend, it doesn't need to be loaded from user space any more. Signed-off-by: Ming Lei --- drivers/base/firmware

[PATCH 2/4] firmware loader: fix one reqeust_firmware race

2012-10-08 Thread Ming Lei
Several loading requests may be pending on one same firmware buf, and this patch moves fw_map_pages_buf() before complete_all(&fw_buf->completion) and let all requests see the mapped 'buf->data' once the loading is completed. Signed-off-by: Ming Lei --- drivers/base/fir

[PATCH 3/4] firmware loader: let direct loading back on 'firmware_buf'

2012-10-08 Thread Ming Lei
y during system resume. Cc: Linus Torvalds Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 171 - 1 file changed, 100 insertions(+), 71 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index f288251..a095d

[PATCH 4/4] firmware loader: sync firmware cache by async_synchronize_full_domain

2012-10-08 Thread Ming Lei
async.c has provided synchronization mechanism on async_schedule_*, so use async_synchronize_full_domain to sync caching firmware instead of reinventing the wheel. Signed-off-by: Ming Lei --- drivers/base/firmware_class.c | 34 ++ 1 file changed, 6 insertions

Re: [PATCH] firmware: Don't attempt to allocate zero bytes with vmalloc()

2012-10-09 Thread Ming Lei
t if that was the case. That doesn't seem If so, I am wondering why the driver has to call request_firmware()? Looks just bypassing request_firmware() is fine for the driver, doesn't it? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kerne

Re: [PATCH] firmware: Don't attempt to allocate zero bytes with vmalloc()

2012-10-09 Thread Ming Lei
zero length, because the driver always expects getting some bytes by calling request_firmware(). Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.ker

Re: [PATCH] firmware: Don't attempt to allocate zero bytes with vmalloc()

2012-10-09 Thread Ming Lei
) is better for the case, _nowait() can avoid unnecessary delay and speedup firmware loading if there are more than one firmware to load. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.o

Re: [PATCH] firmware: Don't attempt to allocate zero bytes with vmalloc()

2012-10-09 Thread Ming Lei
On Tue, Oct 9, 2012 at 8:36 PM, Mark Brown wrote: > On Tue, Oct 09, 2012 at 08:02:18PM +0800, Ming Lei wrote: > >> If loading via user space, timeout or not depends on userspace, >> at least udev won't timeout on non-existent firmware image. > > This may be a md

Re: [PATCH 0/2] Expose firmware paths via procfs

2012-10-10 Thread Ming Lei
; > Once I have some time I hope to also send out a patch that allows > the user to dynamically configure these paths. IMO, kernel parameter should be an appropriate way to configure the path, and the way of /proc or /sys may be a bit late. Thanks, -- Ming Lei -- To unsubscribe from this l

Re: [RFC PATCH v1 1/3] mm: teach mm by current context info to not do I/O during memory allocation

2012-10-17 Thread Ming Lei
sc.may_ should be handled in the same > way. Yes, alloc_page_buffers() and dma_alloc_from_contiguous may drop into the path, so gfp flag should be changed in try_to_free_page() too. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"

Re: [RFC PATCH v1 2/3] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack

2012-10-17 Thread Ming Lei
x27;, could you agree on it? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [Q] reprobe deferred-probing drivers

2012-10-17 Thread Ming Lei
this handling too. But I am wondering how you could get the pointer of device A for releasing driver in device B's remove()? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More major

[PATCH] lib/dma-debug.c: fix __hash_bucket_find

2012-10-18 Thread Ming Lei
. Cc: Joerg Roedel Cc: Shuah Khan Cc: Paul Gortmaker Cc: Andrew Morton Cc: Jakub Kicinski Signed-off-by: Ming Lei --- lib/dma-debug.c |4 1 file changed, 4 insertions(+) diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 94aa94e..be132f3 100644 --- a/lib/dma-debug.c +++ b/li

Re: [PATCH] lib/dma-debug.c: fix __hash_bucket_find

2012-10-18 Thread Ming Lei
Hi, Below v1 should be more efficient and simper, sorry for the noise. Thanks, -- Ming Lei -- >From d275d195794ff80e018145f2fae714b35ddc49e2 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Thu, 18 Oct 2012 23:30:57 +0800 Subject: [PATCH v1] lib/dma-debug.c: fix __hash_bucket_find If there

Re: [PATCH] lib/dma-debug.c: fix __hash_bucket_find

2012-10-18 Thread Ming Lei
the problem. > Re-tested it with and without patch and didn't see the warning with your > patch. > > That said, this patch is malformed and didn't apply cleanly. > You have my > > Tested-by: Shuah Khan OK, I will submit it again for merge. Thanks, -- Ming Le

Re: [RFC PATCH v1 2/3] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack

2012-10-18 Thread Ming Lei
FP_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 -- To unsubscribe from this list: send the line "unsubscribe

[PATCH v1] lib/dma-debug.c: fix __hash_bucket_find

2012-10-18 Thread Ming Lei
. Cc: Joerg Roedel Cc: Shuah Khan Cc: Paul Gortmaker Cc: Andrew Morton Cc: Jakub Kicinski Cc: Fengguang Wu Tested-by: Shuah Khan Signed-off-by: Ming Lei --- v1: - initialize 'last_lvl' as -1 to simplify the fix lib/dma-debug.c |4 ++-- 1 file changed, 2 insertions(

Re: [RFC PATCH v1 1/3] mm: teach mm by current context info to not do I/O during memory allocation

2012-10-18 Thread Ming Lei
be stored first. > > You could add __must_check to the function definition to ensure that > all callers save its return value. Yes, we can do that, but the function name is not better than _save from readability. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "un

Re: [PATCH 0/4] firmware loader: misc changes

2012-10-21 Thread Ming Lei
On Tue, Oct 9, 2012 at 12:01 PM, Ming Lei wrote: > Hi, > > The first two are fixes' patch, the 3rd one is to enable > caching firmware for direct loading, and the last one is > a cleanup patch. > > drivers/base/firmware_class.c | 266 > ++

Re: [PATCH 0/4] firmware loader: misc changes

2012-10-21 Thread Ming Lei
On Mon, Oct 22, 2012 at 12:14 AM, Greg Kroah-Hartman wrote: > > Yes, sorry, they are still in my queue, I was working on other fixes > for other subsystems this past week. I'll get to these tomorrow. No problem, thanks for your work, :-) Thank, -- Ming Lei -- To unsubscribe

[RFC PATCH v2 0/6] solve deadlock caused by memory allocation with I/O

2012-10-22 Thread Ming Lei
| 12 net/core/net-sysfs.c |5 +++ 9 files changed, 127 insertions(+), 2 deletions(-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://

[RFC PATCH v2 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-10-22 Thread Ming Lei
n Cc: KAMEZAWA Hiroyuki Cc: Michal Hocko Cc: Ingo Molnar Cc: Peter Zijlstra Cc: "Rafael J. Wysocki" Signed-off-by: Minchan Kim Signed-off-by: Ming Lei --- v2: - remove changes on 'may_writepage' and 'may_swap' because that isn't related

[RFC PATCH v2 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-10-22 Thread Ming Lei
ice in the path from one block or network device to the root device in the device tree may cause deadlock, the introduced pm_runtime_set_memalloc_noio() sets or clears the flag on device of the path recursively. Cc: "Rafael J. Wysocki" Signed-off-by: Ming Lei --- drivers/base/po

[RFC PATCH v2 3/6] block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices

2012-10-22 Thread Ming Lei
This patch applyes the introduced pm_runtime_set_memalloc_noio on block device so that PM core will teach mm to not allocate memory with GFP_IOFS when calling the runtime_resume callback for block devices. Cc: Jens Axboe Signed-off-by: Ming Lei --- block/genhd.c |8 1 file changed

[RFC PATCH v2 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices

2012-10-22 Thread Ming Lei
c Dumazet Cc: David Decotigny Cc: Tom Herbert Cc: Ingo Molnar Signed-off-by: Ming Lei --- net/core/net-sysfs.c |5 + 1 file changed, 5 insertions(+) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index bcf02f6..9aba5be 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sy

[RFC PATCH v2 5/6] PM / Runtime: force memory allocation with no I/O during runtime_resume callbcack

2012-10-22 Thread Ming Lei
This patch applies the introduced memalloc_noio_save() and memalloc_noio_restore() to force memory allocation with no I/O during runtime_resume callback on device which is marked as memalloc_noio_resume. Cc: Alan Stern Cc: Oliver Neukum Cc: Rafael J. Wysocki Signed-off-by: Ming Lei

[RFC PATCH v2 6/6] USB: forbid memory allocation with I/O during bus reset

2012-10-22 Thread Ming Lei
set() and the storage interface can't do I/O transfer when the reset is triggered by other interface, or the error handling can't be completed if the reset is triggered by the storage itself(error handling path). Cc: Alan Stern Cc: Oliver Neukum Signed-off-by: Ming Lei --- driver

Re: Race condition between driver_probe_device and device_shutdown

2012-12-06 Thread Ming Lei
f probe. Could you test kernel 3.6 or the latest kernel to see if the problem can be reproduced? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.

Re: Race condition between driver_probe_device and device_shutdown

2012-12-06 Thread Ming Lei
27;s lock has to be held in this patch. > What am I missing? Your concern on device_remove() might be correct. Also, I am wondering if we can walk the 'dpm_list' backwards for device shutdown, which should be simpler and more reasonable. Thanks, -- Ming Lei -- To unsubscribe from

Re: Race condition between driver_probe_device and device_shutdown

2012-12-07 Thread Ming Lei
rds for device shutdown, which should >> be simpler and more reasonable. > > How would that help? device_pm_lock() can prevent device_move() from being running. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: Race condition between driver_probe_device and device_shutdown

2012-12-07 Thread Ming Lei
On Fri, Dec 7, 2012 at 11:25 PM, Alan Stern wrote: > On Fri, 7 Dec 2012, Ming Lei wrote: >> device_pm_lock() can prevent device_move() from being running. > > That wouldn't prevent problems during unbinding. Wedson is right; the Right. > places that lock dev->parent

Re: [PATCH RFC 0/4] Add firmware signature file check

2012-11-05 Thread Ming Lei
r check failed, current firmware load will fallback on udev to complete loading, so looks a check-failed firmware still can be loaded into kernel no matter if there is firmware signature check or not. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kerne

Re: [PATCH RFC 0/4] Add firmware signature file check

2012-11-05 Thread Ming Lei
+ The above might be wrong if the firmware file doesn't exist in default search paths. You should skip loading from user space only if verify_signature() returns false. And the udev loading should be resorted to if there is no such firmware file in default search paths. >

Re: [PATCH RFC 0/4] Add firmware signature file check

2012-11-05 Thread Ming Lei
s.sig", fw_path[i], > buf->fw_id); > + if (verify_signature(buf, path)) > + success = true; > + } When direct loading failed, it means that the firmware isn't under the default search path, so the above verification might return false always. T

Re: [PATCH RFC 0/4] Add firmware signature file check

2012-11-06 Thread Ming Lei
On Tue, Nov 6, 2012 at 3:32 PM, Takashi Iwai wrote: > At Tue, 6 Nov 2012 15:16:43 +0800, > Ming Lei wrote: >> >> On Tue, Nov 6, 2012 at 3:03 PM, Takashi Iwai wrote: >> > >> > Yeah, it's just uncovered in the patch. As a easy solution, apply the >

Re: [PATCH RFC 0/4] Add firmware signature file check

2012-11-06 Thread Ming Lei
o distro releases using 3.7-rc since it's still rc. > But what's your point? I mean direct loading hasn't been tested completely, so we don't know which distributions may fallback on user space loading. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscr

Re: [PATCH RFC 0/4] Add firmware signature file check

2012-11-06 Thread Ming Lei
On Tue, Nov 6, 2012 at 6:17 PM, Takashi Iwai wrote: > At Tue, 6 Nov 2012 18:04:36 +0800, > Ming Lei wrote: >> >> On Tue, Nov 6, 2012 at 4:18 PM, Takashi Iwai wrote: >> > >> > Right, and it's intentionally dropped so. For the non-default fw >> >

Re: [PATCH RFC 0/4] Add firmware signature file check

2012-11-06 Thread Ming Lei
age. > > Debug messages are turned off on normal machines, unfortunately. Kernel guys will put one eye on bug report, also enabling udev log can help the problem too. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH v4 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-06 Thread Ming Lei
jobctl flags >> */ >> >> ... >> >> @@ -2304,6 +2304,12 @@ unsigned long try_to_free_pages(struct zonelist >> *zonelist, int order, >> .gfp_mask = sc.gfp_mask, >> }; >> >> + if (unlikely(memalloc_noio())) { >> +

Re: [PATCH v4 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-06 Thread Ming Lei
hild(dev, NULL, >> +dev_memalloc_noio))) >> + break; >> + } >> + mutex_unlock(&dev_hotplug_mutex); >> +} >> +EXPORT_SYMBOL_GPL(pm_runtime_set_memalloc_noio); Thanks, -- Ming Lei -- To unsubscribe from thi

Re: [PATCH v4 0/6] solve deadlock caused by memory allocation with I/O

2012-11-06 Thread Ming Lei
On Wed, Nov 7, 2012 at 7:23 AM, Andrew Morton wrote: > > It generally looks OK to me. I have a few comments and I expect to grab > v5. Andrew, thanks for your review, and I will prepare -v5 later. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe li

Re: [PATCH v4 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-06 Thread Ming Lei
= b1, > }; > > should not be turned into > > struct foo bar { > .a = a1, > }; > > bar.b = b1; > > and we don't want to do > > struct foo bar { }; > > bar.a = a1; > bar.b = b1; &

Re: [PATCH] firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout

2012-11-07 Thread Ming Lei
(test_bit(FW_STATUS_DONE, &(fw_priv->buf->status))) { > + mutex_unlock(&fw_lock); > + return; > + } > + mutex_unlock(&fw_lock); > + > fw_load_abort(fw_priv); > } Also the lock of 'fw_lock' should be held when setting &#x

Re: [PATCH V2] firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout

2012-11-07 Thread Ming Lei
if (timeout != MAX_SCHEDULE_TIMEOUT) > - mod_timer(&fw_priv->timeout, > - round_jiffies_up(jiffies + timeout)); > + schedule_delayed_work(&fw_priv->timeout_work, > +

Re: [PATCH V3] firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout

2012-11-08 Thread Ming Lei
calling fw_load_abort() in timeout function. > > As Ming's proposal, we need change the timer into sched_work to > benefit from using &fw_lock mutex also. > > Signed-off-by: liu chuansheng Acked-by: Ming Lei Thanks, -- Ming Lei -- To unsubscribe from this list: send the li

Re: [PATCH] firmware loader: Fix the concurrent request_firmware() race for kref_get/put

2012-11-09 Thread Ming Lei
struct firmware_cache *fwc = buf->fwc; > + spin_lock(&fwc->lock); > + if(!kref_put(&buf->ref, __fw_free_buf)) $./scripts/checkpatch.pl ERROR: space required before the open parenthesis '(' #97: FILE: drivers/base/firmware_class.c:267: + if(!kref_put

Re: Kernel Firmware - Adding Right way??

2012-11-11 Thread Ming Lei
Seti Units Returned: 19,471 > Processing time: 32 years, 290 days, 12 hours, 58 minutes > (Total Hours: 287,489) > > BOINC@HOME CREDITS > SETI13233290.532525 | EINSTEIN 9012033.029852 > ROSETTA 5329761.808862 | ABC 15417521.047462 > >

Re: Kernel Firmware - Adding Right way??

2012-11-11 Thread Ming Lei
> > Don't write the drivers, so don't know if this is an option. I've only > heard of this issue with the bnx2x driver with HP servers and only > with a couple of users. So, perhaps just manually adding the > bnx2x. You can try to make bnx2x as module to see if

[PATCH v5 0/6] solve deadlock caused by memory allocation with I/O

2012-11-11 Thread Ming Lei
++ include/linux/pm.h |1 + include/linux/pm_runtime.h |3 ++ include/linux/sched.h| 22 ++ mm/page_alloc.c |9 - mm/vmscan.c |4 +- net/core/net-sysfs.c |5 +++ 9 files changed, 154 insertions(+), 5 deletion

[PATCH v5 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-11 Thread Ming Lei
h(call tree) may allocate memory with GFP_KERNEL. Cc: Alan Stern Cc: Oliver Neukum Cc: Jiri Kosina Cc: Andrew Morton Cc: Mel Gorman Cc: KAMEZAWA Hiroyuki Cc: Michal Hocko Cc: Ingo Molnar Cc: Peter Zijlstra Cc: "Rafael J. Wysocki" Signed-off-by: Minchan Kim Signed-off-by: Ming Lei

[PATCH v5 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()

2012-11-11 Thread Ming Lei
device in the path from one block or network device to the root device in the device tree may cause deadlock, the introduced pm_runtime_set_memalloc_noio() sets or clears the flag on device in the path recursively. Cc: Alan Stern Cc: "Rafael J. Wysocki" Signed-off-by: Ming Lei --- v5

[PATCH v5 3/6] block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices

2012-11-11 Thread Ming Lei
This patch applyes the introduced pm_runtime_set_memalloc_noio on block device so that PM core will teach mm to not allocate memory with GFP_IOFS when calling the runtime_resume and runtime_suspend callback for block devices and its ancestors. Cc: Jens Axboe Signed-off-by: Ming Lei --- v5

[PATCH v5 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices

2012-11-11 Thread Ming Lei
ller" Cc: Eric Dumazet Cc: David Decotigny Cc: Tom Herbert Cc: Ingo Molnar Signed-off-by: Ming Lei --- v4: - call pm_runtime_set_memalloc_noio(ddev, true) after device_add --- net/core/net-sysfs.c |5 + 1 file changed, 5 insertions(+) diff --git a/net/core/net-sy

[PATCH v5 5/6] PM / Runtime: force memory allocation with no I/O during Runtime PM callbcack

2012-11-11 Thread Ming Lei
This patch applies the introduced memalloc_noio_save() and memalloc_noio_restore() to force memory allocation with no I/O during runtime_resume/runtime_suspend callback on device with the flag of 'memalloc_noio' set. Cc: Alan Stern Cc: Oliver Neukum Cc: Rafael J. Wysocki Signed-of

[PATCH v5 6/6] USB: forbid memory allocation with I/O during bus reset

2012-11-11 Thread Ming Lei
set() and the storage interface can't do I/O transfer when the reset is triggered by other interface, or the error handling can't be completed if the reset is triggered by the storage itself(error handling path). Cc: Alan Stern Cc: Oliver Neukum Signed-off-by: Ming Lei --- v

Re: [PATCH v5 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-11 Thread Ming Lei
On Sun, Nov 11, 2012 at 8:34 PM, Ming Lei wrote: > +/* GFP_NOIO isn't allowed if PF_MEMALLOC_NOIO is set in current->flags */ > +static inline gfp_t memalloc_noio_flags(gfp_t flags) > +{ > + if (unlikely(current->flags & PF_MEMALLOC_NOIO)) > +

[PATCH v5 1/6] mm: teach mm by current context info to not do I/O during memory allocation

2012-11-11 Thread Ming Lei
h(call tree) may allocate memory with GFP_KERNEL. Cc: Alan Stern Cc: Oliver Neukum Cc: Jiri Kosina Cc: Andrew Morton Cc: Mel Gorman Cc: KAMEZAWA Hiroyuki Cc: Michal Hocko Cc: Ingo Molnar Cc: Peter Zijlstra Cc: "Rafael J. Wysocki" Signed-off-by: Minchan Kim Signed-off-by: Ming Lei

[PATCH v7 0/6] solve deadlock caused by memory allocation with I/O

2013-01-04 Thread Ming Lei
m_runtime.h |3 ++ include/linux/sched.h| 22 +++ mm/page_alloc.c |9 - mm/vmscan.c |4 +- net/core/net-sysfs.c |5 +++ 9 files changed, 152 insertions(+), 4 deletions(-) Thanks, -- Ming Lei -- To unsubscribe from this list: send the

<    1   2   3   4   5   6   7   8   9   10   >