Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3455189ybl; Tue, 21 Jan 2020 00:48:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyl5P/yv0XlMX+bqLcDg8j9uyhMizNjelFnzT53TTnaGOERPB3eIPmjyM4KYi1fRBvcYChN X-Received: by 2002:a9d:4c82:: with SMTP id m2mr2818950otf.199.1579596525970; Tue, 21 Jan 2020 00:48:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579596525; cv=none; d=google.com; s=arc-20160816; b=l8AZLqbmNHabe0XDqV87lTShC8k/dV0oiTUsYX0yECM6983bQ+u48mcBnPBjzkjMb3 PyC+wSJnNEqijXyHXaeIvuRqIH040ep4OQ04xpdIEZmEV4A/NsBqrWCAMDVBfz8hC3k8 8I5VGUEgIioDbM8kOEfE7KlYiPfK/UDUlN6G0BPMEnZo5OH/3IFirZkNciZc+7cNu+yG zTf22G4/XDvFktaFa43dE3kiYCwNISAcGRZFlMCsGWfUzKQXTYRdYZhJRxVGZlpfOEAT xRUSNDzcoEpUdiN6Mg9sK4YmApy2IZqW8X1lSjLbh4080HO8GEqqtjFbUd6kHvz9wSJU yuiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=A2Jq4UlfexjtmVkY83w3tCLe5tcHuhDfyWxnlQ/y19k=; b=geytNZUcS9ZNI/qANR/Ia4JblC1VFG4ssNQcUgVs3r+wGqwla/o0YSST+r+JOdzJM5 xQ+FHZSg6iBFkfoHtP3mjErO7yXWlFKj+uPG5jPGKVFsF94VGs3YtsS3p+SYZ/mla6II 8cg+haiu0Vr9t0QR1A5GPQI0Ij+pn1faFBM0trt68fFZORTZiFsJRXuu2U/vEF3gHw+I fRqe/FkbJ6+V/0xF/u0fDnX3X4aQqLuOFO1LFBjdcmhczliIr4p6/3vRqOkih8C/0NvN nKszw/TYQBp3DrxZKaTYQ/qcoDWWxZbtb550DWf3QLFHUnpKf4YkmcfWaZZGE0iKqUKG Ya3A== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r202si19594454oie.247.2020.01.21.00.48.33; Tue, 21 Jan 2020 00:48:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727847AbgAUIrR (ORCPT + 99 others); Tue, 21 Jan 2020 03:47:17 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40355 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgAUIrR (ORCPT ); Tue, 21 Jan 2020 03:47:17 -0500 Received: by mail-wr1-f68.google.com with SMTP id c14so2157706wrn.7 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=DYcvUz9PRBdbY3i7K8eNMQ/krVzqvBjrAlY5GXlY5syu/FO6lESPBwJM6Zu9vhaWdb QQl3b7B4vf8b/Vk0kJNsoRI2WAhIotg9FAEoeHfwyrBzQcqp3PxLE9k83P3sFzzbArxZ zVLgnDybcPMAVW0thQsB3nfl3tCI/5Qv7xTjMROb9S0r3FZawFiSE1HlOoBsguQjAko0 cDUB3RRWDwTQ1q0HAal5yV8hRkdT+ITaqeg+clujqQ4MTBlmS93lLj5ZM4g1sGoxcReb mWsWr6jAAywq6Z3VPum6R/H3JMSr214T0L7oJEb4ebtz0EymqcikSpruqiUiylFRGC+J cldA== X-Gm-Message-State: APjAAAXHM7rmHenpTp53GUiUghFze2OercczTUCCK1JYCnME/w/CpGjJ pPW8I0ANBlMcJI6FaXdfhx4ss8Bn 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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