Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3721029ybi; Sun, 14 Jul 2019 20:50:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqy59bG/JEuBbMhbB0aIEjy2BaiqkaRspM2iMoQfLxlwtATX9XwEtv+ioiKR/ZmcuijzzDeR X-Received: by 2002:a17:902:2868:: with SMTP id e95mr24292210plb.319.1563162634184; Sun, 14 Jul 2019 20:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563162634; cv=none; d=google.com; s=arc-20160816; b=GINXWwvqjB2rc4uG/rPosRALfNw/ni7X4/8WEsXA3PItR6SdhI39wyBKef4exw4v6/ 0nyLosI5VR4KEjPGndHzwM0KHRfjKOxmydYNI4gtCKcgAOmY/XjmNnlOuCpqPTig4bk8 B9XTd/dMLUX8P0g4gUCPEYq+Zg1CVLf3G5tZ9qFClGUrZGwSSpO+xC9xK0FTgZ4a6D2S XQt7nKeUeiRFN5AC+VApMIpbpsZ51vpcBGNTUqPO4iG/MvVXhthsYXzRKPmgLq2Dw/JB pTx4bCEUeTYa/V5MKM+fwpRHXq2KV4qTO6nXQ2GZSRSU5oYwiBpbi1mivcGCDvSopFGf GwyA== 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=pRIOLTj14InRChOhSXXifW2h5qvWL/LGTx3Bdv0Ebjw=; b=yGB79pZknw8VAbIap0kwZbKpLqEfWVn/vscvQR+ElltyEmEYPePtqwupm7+A0mq81P VRCDS8ql+G2aauGIDZU+Zsa+3dQfXQ1d/9qsS+vKk3gJTaSsfrriNeY7xEM2GroQApXO tBgoMFbryi6Y90I5Qy+tTZrcWljMr5IClLzTFL3esDLqdu37U+1eaNrs08D3R+HoCp/1 3roA/rvyTY6h/vZmCuwQABJ75DawI/TblYMiKmx2ZjOZ9zubSURVkE4rgwG8nkvPHHL3 hxzhxcxQoJqqF0Euztb5YeoCnXjnToWpfjyUaTIOmrVQz7gHqWU9PBW5lCW4g0FTgwuj jaqg== 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 y15si14993268pjp.90.2019.07.14.20.49.41; Sun, 14 Jul 2019 20:50:34 -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 S1729064AbfGODre (ORCPT + 99 others); Sun, 14 Jul 2019 23:47:34 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:45755 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726916AbfGODre (ORCPT ); Sun, 14 Jul 2019 23:47:34 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R961e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TWuAKbH_1563162430; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0TWuAKbH_1563162430) by smtp.aliyun-inc.com(127.0.0.1); Mon, 15 Jul 2019 11:47:13 +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> From: Yang Shi Message-ID: <4b4eb1f9-440c-f4cd-942c-2c11b566c4c0@linux.alibaba.com> Date: Sun, 14 Jul 2019 20:47:07 -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: <20190713212548.GZ32320@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/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.