From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E5DC2D0CE for ; Tue, 21 Jan 2020 08:47:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3F8C622522 for ; Tue, 21 Jan 2020 08:47:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F8C622522 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D25F06B0006; Tue, 21 Jan 2020 03:47:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CD6E86B0007; Tue, 21 Jan 2020 03:47:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BECB66B0008; Tue, 21 Jan 2020 03:47:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id A4BE46B0006 for ; Tue, 21 Jan 2020 03:47:17 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 57E59824805A for ; Tue, 21 Jan 2020 08:47:17 +0000 (UTC) X-FDA: 76401012114.15.war12_3f96cec38285f X-HE-Tag: war12_3f96cec38285f X-Filterd-Recvd-Size: 3998 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Jan 2020 08:47:16 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id j42so2122586wrj.12 for ; Tue, 21 Jan 2020 00:47:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A2Jq4UlfexjtmVkY83w3tCLe5tcHuhDfyWxnlQ/y19k=; b=KqprpKx3bMY3fOP75qfl4NyYZOZoUc+4nlImheSCH9t51qcaJ/CAjzoAplaymVM3/x pPbfTRAh3tlE1UxkxIuoHvWy+BayuCXHYPNEa2/Gcw6PCXEYQERcUPHfbSHkBSGv2IC8 4tITv2piH9XrQGhqx7oiDV6RK1OL5VNDUaa4CGWVVrTDhLzOnsHODGOtK73p08KgyP6b uhxwWXMTqwGINHfckI8c1ZuRgiFtK3VjaLQmUJGhzJxNHUs3kVYFTKoBslRQttPRwBJ9 zQDGRi6TCTWsS7bMj5OiS70GJacdIkgWuZxgKcCeX/0GnVNBw/ADUQO40bUlxFtJ2wSj QQOA== X-Gm-Message-State: APjAAAXGAh5/69+1Q4klo/xLrtD90AT0/sUr6b3w9+ygjduapATsNF5+ Bq/ti6skHPjcLDicCv69nlw= X-Google-Smtp-Source: APXvYqw1p5Rcn7Z8ld4e+Gmx0HTfIMMJYbcXddl3v3YURFj3nrwbOyaH3Rq+L4haaBDPEgq1E9lk8A== X-Received: by 2002:a5d:6349:: with SMTP id b9mr3962551wrw.346.1579596435896; Tue, 21 Jan 2020 00:47:15 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id f207sm3355865wme.9.2020.01.21.00.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 00:47:15 -0800 (PST) Date: Tue, 21 Jan 2020 09:47:14 +0100 From: Michal Hocko To: Anshuman Khandual Cc: Wei Yang , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, rientjes@google.com Subject: Re: [Patch v2 3/4] mm/page_alloc.c: pass all bad reasons to bad_page() Message-ID: <20200121084714.GF29276@dhcp22.suse.cz> References: <20200120030415.15925-1-richardw.yang@linux.intel.com> <20200120030415.15925-4-richardw.yang@linux.intel.com> <20200120102200.GW18451@dhcp22.suse.cz> <2288c80c-42f7-a161-58cf-47cf07699202@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2288c80c-42f7-a161-58cf-47cf07699202@arm.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000008, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 21-01-20 11:38:29, Anshuman Khandual wrote: > > > 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 ? Do you see any particular problem with the existing logic? I find a single reason sufficient and a good lead for what to check most of the time. -- Michal Hocko SUSE Labs