From patchwork Tue Oct 25 11:44:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 9394375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 67C3D6077F for ; Tue, 25 Oct 2016 11:44:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56C8829539 for ; Tue, 25 Oct 2016 11:44:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4978C29537; Tue, 25 Oct 2016 11:44:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97DF829537 for ; Tue, 25 Oct 2016 11:44:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755465AbcJYLol (ORCPT ); Tue, 25 Oct 2016 07:44:41 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47826 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055AbcJYLok (ORCPT ); Tue, 25 Oct 2016 07:44:40 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9PBi4Jd037705 for ; Tue, 25 Oct 2016 07:44:40 -0400 Received: from e06smtp09.uk.ibm.com (e06smtp09.uk.ibm.com [195.75.94.105]) by mx0a-001b2d01.pphosted.com with ESMTP id 269yh1wsr7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 25 Oct 2016 07:44:40 -0400 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Oct 2016 12:44:37 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp09.uk.ibm.com (192.168.101.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 25 Oct 2016 12:44:36 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 02CFE1B0804B; Tue, 25 Oct 2016 12:46:42 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9PBiZkP27852926; Tue, 25 Oct 2016 11:44:35 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9PBiZOv002322; Tue, 25 Oct 2016 05:44:35 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u9PBiZ14002312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Oct 2016 05:44:35 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id EE0AE20F626; Tue, 25 Oct 2016 13:44:34 +0200 (CEST) From: Christian Borntraeger To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Borntraeger Subject: [PATCH] blk-cgroup: use __GFP_NOWARN for NOWAIT allocations Date: Tue, 25 Oct 2016 13:44:32 +0200 X-Mailer: git-send-email 2.5.5 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102511-0036-0000-0000-0000024AF7C8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102511-0037-0000-0000-000012FE1E18 Message-Id: <1477395872-33696-1-git-send-email-borntraeger@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-25_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610250204 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I just got qemu-system-s39: page allocation failure: order:0, mode:0x2200000(GFP_NOWAIT|__GFP_NOTRACK) CPU: 0 PID: 6664 Comm: qemu-system-s39 Tainted: G 4.9.0-rc2+ #44 [...] ([<000000000011230a>] show_trace+0x62/0x78) ([<00000000001123da>] show_stack+0x72/0xf0) ([<00000000004a7906>] dump_stack+0x7e/0xb0) ([<000000000025df14>] warn_alloc+0x11c/0x148) ([<000000000025e48c>] __alloc_pages_nodemask+0x4c4/0xe50) ([<00000000002be590>] new_slab+0x560/0x778 ([<00000000002c0adc>] ___slab_alloc.constprop.29+0x2b4/0x368) ([<00000000002c0bc4>] __slab_alloc.constprop.28+0x34/0x50) ([<00000000002c10aa>] kmem_cache_alloc_trace+0x20a/0x270) ([<0000000000257934>] mempool_create_node+0x5c/0x188) ([<00000000004745d6>] blk_init_rl+0xa6/0xe0) ([<0000000000493f58>] blkg_alloc+0x150/0x2a8) ([<0000000000494404>] blkg_create+0x354/0x3b0) ([<00000000004962c0>] blkg_lookup_create+0x100/0x180) ([<0000000000472cd4>] generic_make_request_checks+0x504/0x590) ([<0000000000474a66>] generic_make_request+0x2e/0x1b0) ([<0000000000474c8c>] submit_bio+0xa4/0x178) ([<000003ff80c64670>] btrfs_map_bio+0x1c0/0x3c8 [btrfs]) ([<000003ff80c3075c>] btrfs_submit_bio_hook+0x104/0x210 [...] Seems that blk-cgroup can handle allocation failures quite will - it does check the result and the system continues to run, so let's make allocation failures silent in here. There are other GFP_NOWAIT places in that file, but not all seem to check the return value. In addition this warning seems to be the only one that I can reliably reproduce so I decided to only touch blkg_create. Signed-off-by: Christian Borntraeger --- block/blk-cgroup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index b08ccbb..d22bd95 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -185,7 +185,8 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, } wb_congested = wb_congested_get_create(&q->backing_dev_info, - blkcg->css.id, GFP_NOWAIT); + blkcg->css.id, + GFP_NOWAIT | __GFP_NOWARN); if (!wb_congested) { ret = -ENOMEM; goto err_put_css; @@ -193,7 +194,7 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, /* allocate */ if (!new_blkg) { - new_blkg = blkg_alloc(blkcg, q, GFP_NOWAIT); + new_blkg = blkg_alloc(blkcg, q, GFP_NOWAIT | __GFP_NOWARN); if (unlikely(!new_blkg)) { ret = -ENOMEM; goto err_put_congested;