Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4243976ybi; Mon, 15 Jul 2019 06:08:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRCTsL8j48Mt+8QWg6zBqavM04PGb1gfkkvekwbYJxBjBIoDMIk0Rn4/oUyhX6VIryppnO X-Received: by 2002:a17:902:24c:: with SMTP id 70mr28152480plc.2.1563196106160; Mon, 15 Jul 2019 06:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563196106; cv=none; d=google.com; s=arc-20160816; b=Mlwb4wCHp+kEzrpZdWhRkUc9B0Yj5rc30HGFccbfN7MwHMqf6LFOJpb4iT8a/Fea4W omy0JLRo5rLxn9eDUlwRZN21beXUdruZc2tpvUt9zBkqyIFsvwY3fnT7XC2SackQSRFH 9OSs5WdmRhVys3CLCMmk+9MKL2bjAQXaXVxcTOT2wHAtvHSh3BqhoGJtQzIAH8w7H9vm wMV0RbiaBXk5Xg4JMMZvrSm/LgnI0kluDfTeTb52vsvBmzeR9UMjfDKlwLM1ffFt0lbi qfTYMmM89fmNh+Wz7qZx3vsiAc1+dNDpbKI7cFXb/inatb6claFzRRVlIJnKfptWgzXH mT4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=S6d0Uh9ElvljaSsYjmJyZ6Glp9AxqeU2DyFta5bh0Vk=; b=pEV0YhhKGObwlEIOnWgcy53OYPy/RXfxdQtPvfmn31VvIhWr4vgCFzdEcmZVcvCVut DA8UftP6GYKCdttTwd5MySnxMZ1pl1TsBg/A+naq3K5afzJvl6wyCoXC39aHG1MJhP0L 64JTXr9QcVA1bq1NEnol7cGbPzQ6yZyl0XuUZ5827yByJW2K99+eixPfdvRg3k5VCN+y QTzLs5imCT2FN16yM8ABTCMabdFWkV9h9uvyNuQBch7H4axRf0zdd0KJST3U0Wrpq5IJ BCWl808z7LgrA9Sjf9G+uwEiCihQWP1PWaWYJmMBNDpB1ohjNOBAVKkP87SLoovDCAm3 +AMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=q0Qsqf7x; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78si15855742pga.411.2019.07.15.06.08.08; Mon, 15 Jul 2019 06:08:26 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=q0Qsqf7x; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730144AbfGONG6 (ORCPT + 99 others); Mon, 15 Jul 2019 09:06:58 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58978 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730048AbfGONG6 (ORCPT ); Mon, 15 Jul 2019 09:06:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=S6d0Uh9ElvljaSsYjmJyZ6Glp9AxqeU2DyFta5bh0Vk=; b=q0Qsqf7xUmcdfbA8LatL4rZ+4 4U+CqUCE7HPY1UJD/kTOy9twF8VftEu1clxmugXS00IRnERoxvFxg6C8tnlXDgnSpS0olgjtVoIES U8x6xMrZh6NVol0Edv2GSBuFRQKGjnawJ7BbhQZP+DUKnfahSLfYqu1ZxkJC8WzYnB0xb81ksKnIm 0rjp+iUd8e9NwMP8p3Ov4NnE2mignjQ2Bi3UipKXSTzzBNsCfnyDnYzugrhCCw41AkbNENZuBfEMu y9/KJ5pMqPj64kBhtxgoDEGBlsnbYLsjEYjQh2VWotOgvw+r846gZJXDhYl0HIz4gPt6Qehf9Z6Gd txYH2h7Gg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hn0gq-0000nW-QN; Mon, 15 Jul 2019 13:06:48 +0000 Date: Mon, 15 Jul 2019 06:06:48 -0700 From: Matthew Wilcox To: Yang Shi Cc: mhocko@suse.com, dvyukov@google.com, catalin.marinas@arm.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: page_alloc: document kmemleak's non-blockable __GFP_NOFAIL case Message-ID: <20190715130648.GA32320@bombadil.infradead.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b4eb1f9-440c-f4cd-942c-2c11b566c4c0@linux.alibaba.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.