Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11172231ybi; Thu, 25 Jul 2019 11:13:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcVTRrAsIb2WItD2BkAxll8sToM7+JZP+jwukhsinMJofkwvmb7TEd9yrw8oF3TnEsMQVw X-Received: by 2002:a65:6294:: with SMTP id f20mr89799007pgv.349.1564078410269; Thu, 25 Jul 2019 11:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564078410; cv=none; d=google.com; s=arc-20160816; b=SAwo4fS1e7/JA0MpglJM7EMPPr2I8OHQ5ZJkrMPsUS93KqJVV1ENNXGykFGyS3jbP6 L+a1BE3rSajVs31+KkaiKdSO7CLaMyPH4UC6XFFkr7MnwMTlPI/uaV7/gAjR2PAPoKoi Q8f9HZ9dvNrQzfgIs0cowsOxiP0FoAKHjylXTceM4FmNfZ+qtccXiuE1OIkzRrYfv3h/ oCR8enCBiPH2MOWxqLhcmi44of0aZu+PQcZFJXvTOas04OruUqDtKCUz1Ed07ZC6Lh1H RpY5R3f5wdyNezf7fTXwiBAfRfJ6VFL285T5YQjla+TugSoxjHqPEcx4GMffWpGi5CCq BUzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=e4m6puvB10EHfZzDVgE/4cPEhExXNSF5xqCUc7jJOlE=; b=AlCQ+DHn0WxPtFl9mGH6es9vt8NVYwYAMDf0p6e7VkQq7VQyNOsc2UO+eYR52GIwqO LmPThRyUDFUBy4adm0pd0j8A0lj2EQ5sZFUNimg/mNjwONnmLS49aPcfZdFh6pBkTYsx JjmNY5fWWXDydh8Pkhkeq6LYKmrQD7ilE4Ihx/ES+mbYVBazBVYisvLSTO/lmSWD7ipz rJHPa1Pg/rJGcmvwtHmMBVmVfdEYN2PafAmmOfTQ3L2qqd9IgsqRf22KP10pedShpxO7 AqPCq3FaDKjvShjyk0Z0tVdcFzmYiY3l9iPvObuffXSq2pScVqXeXA5hnu+rRm0Mr/yk eIzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si18167097plv.130.2019.07.25.11.13.15; Thu, 25 Jul 2019 11:13:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729739AbfGYRVT (ORCPT + 99 others); Thu, 25 Jul 2019 13:21:19 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:43761 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbfGYRVT (ORCPT ); Thu, 25 Jul 2019 13:21:19 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04391;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0TXn99.H_1564075272; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TXn99.H_1564075272) by smtp.aliyun-inc.com(127.0.0.1); Fri, 26 Jul 2019 01:21:15 +0800 Subject: Re: [PATCH] mm: page_alloc: document kmemleak's non-blockable __GFP_NOFAIL case To: Andrew Morton Cc: mhocko@suse.com, dvyukov@google.com, catalin.marinas@arm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1562964544-59519-1-git-send-email-yang.shi@linux.alibaba.com> <20190724194835.59947a6b4df3c2ae7816470d@linux-foundation.org> From: Yang Shi Message-ID: Date: Thu, 25 Jul 2019 10:21:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20190724194835.59947a6b4df3c2ae7816470d@linux-foundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/24/19 7:48 PM, Andrew Morton wrote: > On Sat, 13 Jul 2019 04:49:04 +0800 Yang Shi wrote: > >> When running ltp's oom test with kmemleak enabled, the below warning was >> triggerred since kernel detects __GFP_NOFAIL & ~__GFP_DIRECT_RECLAIM is >> passed in: >> >> ... >> >> The mempool_alloc_slab() clears __GFP_DIRECT_RECLAIM, kmemleak has >> __GFP_NOFAIL set all the time due to commit >> d9570ee3bd1d4f20ce63485f5ef05663866fe6c0 ("kmemleak: allow to coexist >> with fault injection"). >> >> The fault-injection would not try to fail slab or page allocation if >> __GFP_NOFAIL is used and that commit tries to turn off fault injection >> for kmemleak allocation. Although __GFP_NOFAIL doesn't guarantee no >> failure for all the cases (i.e. non-blockable allocation may fail), it >> still makes sense to the most cases. Kmemleak is also a debugging tool, >> so it sounds not worth changing the behavior. >> >> It also meaks sense to keep the warning, so just document the special >> case in the comment. >> >> ... >> >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -4531,8 +4531,14 @@ bool gfp_pfmemalloc_allowed(gfp_t gfp_mask) >> */ >> if (gfp_mask & __GFP_NOFAIL) { >> /* >> - * All existing users of the __GFP_NOFAIL are blockable, so warn >> - * of any new users that actually require GFP_NOWAIT >> + * The users of the __GFP_NOFAIL are expected be blockable, >> + * and this is true for the most cases except for kmemleak. >> + * The kmemleak pass in __GFP_NOFAIL to skip fault injection, >> + * however kmemleak may allocate object at some non-blockable >> + * context to trigger this warning. >> + * >> + * Keep this warning since it is still useful for the most >> + * normal cases. >> */ > Comment has rather a lot of typos. I'd normally fix them but I think > I'll duck this patch until the kmemleak situation is addressed, so we > can add a kmemleakless long-term comment, if desired. Actually, this has been replaced by reverting the problematic commit. And, the patch has been in -mm tree. Please see: revert-kmemleak-allow-to-coexist-with-fault-injection.patch I think we would like to have this merged in 5.3-rc1 or rc2?