Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755206AbZKQHRG (ORCPT ); Tue, 17 Nov 2009 02:17:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753841AbZKQHRF (ORCPT ); Tue, 17 Nov 2009 02:17:05 -0500 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:58420 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbZKQHRE (ORCPT ); Tue, 17 Nov 2009 02:17:04 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: LKML Subject: [PATCH 1/7] dm: use __GFP_HIGH instead PF_MEMALLOC Cc: kosaki.motohiro@jp.fujitsu.com, linux-mm , Andrew Morton , Alasdair G Kergon , dm-devel@redhat.com In-Reply-To: <20091117161551.3DD4.A69D9226@jp.fujitsu.com> References: <20091117161551.3DD4.A69D9226@jp.fujitsu.com> Message-Id: <20091117161616.3DD7.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Tue, 17 Nov 2009 16:17:07 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1732 Lines: 61 Non MM subsystem must not use PF_MEMALLOC. Memory reclaim need few memory, anyone must not prevent it. Otherwise the system cause mysterious hang-up and/or OOM Killer invokation. Cc: Alasdair G Kergon Cc: dm-devel@redhat.com Signed-off-by: KOSAKI Motohiro --- drivers/md/dm-ioctl.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index a679429..4d24b0a 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1396,7 +1396,13 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl **param) if (tmp.data_size < (sizeof(tmp) - sizeof(tmp.data))) return -EINVAL; - dmi = vmalloc(tmp.data_size); + + /* + * We use __vmalloc(__GFP_HIGH) instead vmalloc() because trying to + * avoid low memory issues when a device is suspended. + */ + dmi = __vmalloc(tmp.data_size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_HIGH, + PAGE_KERNEL); if (!dmi) return -ENOMEM; @@ -1473,20 +1479,10 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user) DMWARN("dm_ctl_ioctl: unknown command 0x%x", command); return -ENOTTY; } - - /* - * Trying to avoid low memory issues when a device is - * suspended. - */ - current->flags |= PF_MEMALLOC; - /* * Copy the parameters into kernel space. */ r = copy_params(user, ¶m); - - current->flags &= ~PF_MEMALLOC; - if (r) return r; -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/