Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3342665ybl; Mon, 20 Jan 2020 22:08:20 -0800 (PST) X-Google-Smtp-Source: APXvYqx7Fb9+cVPaGbXsiwWJpJ5H4yTsVi4WzWiFIfTlBMuPwQMi9vs2kkiAdSWTdm34UZIJvOAi X-Received: by 2002:a9d:24ea:: with SMTP id z97mr2409256ota.345.1579586900010; Mon, 20 Jan 2020 22:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579586900; cv=none; d=google.com; s=arc-20160816; b=SQOsExJ/X7LJfss5ITBM8fB04qjXHBY+dMILJF3Ur8zXLWRqfMRoI9GTPZxWrHSaw3 0o0K5Tjw1j0x7RAZ/nmvAfMdle32qiOrcK6B1uEV1frtdRMYaTz0d5ulHF9cG9aEqbZe IvOxM7MO4osaT5NvFEVtgMGlUPrmTinsYaiPb22H1xVnser7b0go+BPJZAZHoEh7sDMC 4EpgBzsahZ4rGuQuxX6cemyWMvPw4kEr9aMkfQ/AQozGo7HirLdn5hbdiQJqG7/g2YR9 4JbiluVc0GERCoLJCWLR3iq0N8EbnaCemaINj0iXBhLkRpZ47X3+OHmoqAlqzvauQv2S KIfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=tYIxtvlEymdhltpml8oacikqnP05Vb0FOE+JkQmGhWA=; b=VrNoCHz2osHfMFMB3FUKjO0kx5NZzocynbTBGqcwbc27oAPwOPOEmjkbDZ1wNp5XSy BVKQ1XFxouAG6iKPXYsQynWhODWUSSlmmLv7ZkHVC/tdQ1xa+E4vqbAYtwc5y3IhuXHd PkbD2p9oVxzRv+SrkhgiygzZASnXDNKq3mPUtYFm65SwfVZarwyiUv0jngsTKlQbPUfN Mx1BUUtHwBvUpgc8J5xSIux7JS5o1TwAP8svXIiJb9oolU76PnYXbhU3zsSSnq0XIGXO k7f96NCnSiJ4GFevIn57xEeceIf6wXtFDBTjQWcGmzEFWccg8fxIUPsDBP1im5Nv5+EA /GdQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u18si9503644oif.66.2020.01.20.22.08.06; Mon, 20 Jan 2020 22:08:19 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbgAUGHJ (ORCPT + 99 others); Tue, 21 Jan 2020 01:07:09 -0500 Received: from foss.arm.com ([217.140.110.172]:38482 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbgAUGHJ (ORCPT ); Tue, 21 Jan 2020 01:07:09 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 89B0131B; Mon, 20 Jan 2020 22:07:08 -0800 (PST) Received: from [10.162.16.78] (p8cg001049571a15.blr.arm.com [10.162.16.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC8A73F52E; Mon, 20 Jan 2020 22:07:06 -0800 (PST) Subject: Re: [Patch v2 3/4] mm/page_alloc.c: pass all bad reasons to bad_page() To: Michal Hocko , Wei Yang Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rientjes@google.com References: <20200120030415.15925-1-richardw.yang@linux.intel.com> <20200120030415.15925-4-richardw.yang@linux.intel.com> <20200120102200.GW18451@dhcp22.suse.cz> From: Anshuman Khandual Message-ID: <2288c80c-42f7-a161-58cf-47cf07699202@arm.com> Date: Tue, 21 Jan 2020 11:38:29 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200120102200.GW18451@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/20/2020 03:52 PM, Michal Hocko wrote: > On Mon 20-01-20 11:04:14, Wei Yang wrote: >> Now we can pass all bad reasons to __dump_page(). > And we do we want to do that? The dump of the page will tell us the > whole story so a single and the most important reason sounds like a > better implementation. The code is also more subtle because each caller > of the function has to be aware of how many reasons there might be. > Not to mention that you need a room for 5 pointers on the stack and this > and page allocator might be called from deeper call chains. > Two paths which lead to __dump_page(), dump_page() and bad_page(). Callers of dump_page() can give a single reason what they consider the most important which leads to page dumping. This makes sense but gets trickier in bad_page() path. At present, free_pages_check_bad() and check_new_page_bad() has a sequence of 'if' statements which decides "most important" reason for __dump_page() without much rationale and similar in case of free_tail_pages_check() as well. As all information about the page for corresponding reasons are printed with __dump_page() anyways, do free_pages_check_bad() or check_new_page_bad() really need to provide any particular single reason ?