Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4511348ybi; Mon, 15 Jul 2019 10:03:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSC5F5IVJQkHHNLaL8lH9DfXqKDx24kKw0RfiUc/91kKEe0KPuIrcVyzzHTIGyAZYZGhuj X-Received: by 2002:a17:90a:2768:: with SMTP id o95mr30294720pje.37.1563210195260; Mon, 15 Jul 2019 10:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563210195; cv=none; d=google.com; s=arc-20160816; b=sQLgx6NwMYBruRUWUrsu8Gcx3kn+VmUeF29UOyfHsbYUtMd3X2WzmUw2HBzCfiuDjV SNTppaIvCQJ7nb/YhpQDfYVwvIePObYMZEK9VD5pfE7wQ8SjPK8rMjOLJaO3pI1+izls 3oXL7s6rTXfKh1CZL55UN8cyjyU8FSOlyc8Ra2r3gn485EvQi40kOQ+XSz5ax0eeM9pO f7Nh32CNEPo1SRzURAYZjSMzxoQxVRGaA0JN/c39mFjhNHbTHDv3LrYGZ/ZzyiAMRlzi kqjVHo0KBTavXpz+EFFMHH6kc20rwQBl9eJS+8K6927h3lfzH4tWhFF9F45IrpULXr7r sIpQ== 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=fnmOM86QVifGTF/kFu3dVJQXgDGj1CuabsUs3lLdtXg=; b=HJe0bWpvZyCzHeAsmox9cMajqukoLv9oZ0CUdw6Hk9QFK7J3rwMnuv+fvXDDxxjiJ3 apDrBT90y6z23xV3MPArQSJtd4PfbVXAaV5We+Zdfsqz6Kt5pF6X4gQ0pGmVbXxB06wS UAKQSuWqHOcBIkyHBJCKFX5Noc2u5G/0118UuEjcCbQotmU6VGqBkCNpW5tqok33nkQT l5OlpB8YIOikKixrOtyt5TJCELdPiL+U21MqAA/VjYF0NvM241ohH/BXvps1stA/ki9h 9lm5Bl4kj3SyCjCN+I64Uuu/hKiZJ9G5h8Su92GvHwsBuB0MxgEeiEidsbvlvKBi7Aii FRyA== 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 m129si17656751pfm.15.2019.07.15.10.02.56; Mon, 15 Jul 2019 10:03:15 -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 S1731493AbfGORAn (ORCPT + 99 others); Mon, 15 Jul 2019 13:00:43 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:33978 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730436AbfGORAn (ORCPT ); Mon, 15 Jul 2019 13:00:43 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04446;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TX.KuoP_1563210037; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TX.KuoP_1563210037) by smtp.aliyun-inc.com(127.0.0.1); Tue, 16 Jul 2019 01:00:40 +0800 Subject: Re: [PATCH] mm: page_alloc: document kmemleak's non-blockable __GFP_NOFAIL case To: Matthew Wilcox Cc: mhocko@suse.com, dvyukov@google.com, catalin.marinas@arm.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1562964544-59519-1-git-send-email-yang.shi@linux.alibaba.com> <20190713212548.GZ32320@bombadil.infradead.org> <4b4eb1f9-440c-f4cd-942c-2c11b566c4c0@linux.alibaba.com> <20190715130648.GA32320@bombadil.infradead.org> From: Yang Shi Message-ID: Date: Mon, 15 Jul 2019 10:00:34 -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: <20190715130648.GA32320@bombadil.infradead.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/15/19 6:06 AM, Matthew Wilcox wrote: > On Sun, Jul 14, 2019 at 08:47:07PM -0700, Yang Shi wrote: >> >> On 7/13/19 2:25 PM, Matthew Wilcox wrote: >>> On Sat, Jul 13, 2019 at 04:49:04AM +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: >>> There are lots of places where kmemleak will call kmalloc with >>> __GFP_NOFAIL and ~__GFP_DIRECT_RECLAIM (including the XArray code, which >>> is how I know about it). It needs to be fixed to allow its internal >>> allocations to fail and return failure of the original allocation as >>> a consequence. >> Do you mean kmemleak internal allocation? It would fail even though >> __GFP_NOFAIL is passed in if GFP_NOWAIT is specified. Currently buddy >> allocator will not retry if the allocation is non-blockable. > Actually it sets off a warning. Which is the right response from the > core mm code because specifying __GFP_NOFAIL and __GFP_NOWAIT makes no > sense. Yes, this is what I meant. Kmemleak did a trick to fool fault-injection by passing in __GFP_NOFAIL, but it doesn't make sense for non-blockable allocation.