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 AA2F1C43331 for ; Mon, 30 Mar 2020 12:34:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7353A206E6 for ; Mon, 30 Mar 2020 12:34:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7353A206E6 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 1D8EC6B0037; Mon, 30 Mar 2020 08:34:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 188176B006C; Mon, 30 Mar 2020 08:34:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C4E36B006E; Mon, 30 Mar 2020 08:34:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id E74256B0037 for ; Mon, 30 Mar 2020 08:34:05 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C42E282499A8 for ; Mon, 30 Mar 2020 12:34:05 +0000 (UTC) X-FDA: 76651970850.17.hall23_5df07b025be46 X-HE-Tag: hall23_5df07b025be46 X-Filterd-Recvd-Size: 3951 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Mar 2020 12:34:05 +0000 (UTC) Received: by mail-wm1-f43.google.com with SMTP id f6so15097579wmj.3 for ; Mon, 30 Mar 2020 05:34:05 -0700 (PDT) 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=Em2aQuXf0JSg6irJFEUCAhD/JvrnovGDSXnE0eBhJyg=; b=B+byLTkzcYX+nvUh1D/mlfIwyMLaF/dEjPEeODTHETD1phCRThZoTlLT6LcL3g25pH DRjEEdQNnmRlnox1IOTGcQZJPivXCR0UBvRu2EiijY2JqIeq4fJ2aquKQjPqJPGEjHo8 OqAV6ShbBVxrg5sQWG9IE5q0WM4WsOP0XHOpKc+g5f0BMLJHdXlgsj4RVIiPsghRpoJb 6BdOWxyZAB40ULxDj0tDObWByQu6F0Q53XtUaIfxlfXFOh3R+g0lo7h3SfTk97O47SKT nuBxaISVx1kRV0ycG6ICrkzMiY0SgiotDieSQEHp5FIuC3aMDpGbo8t6GLSdSP3Bg/zK 9E2Q== X-Gm-Message-State: ANhLgQ0ssCizJ0XDT9gDIdqRbpFqjbqIGSEd2MfGtzJMPr7HHEP07u5f 7L/lS0klqJ0P33m2aHiQKI4= X-Google-Smtp-Source: ADFU+vu41LA/m+g3AiN1pF7fnyL47hSltXVxaY1ddpeSVpuljI2zOSF9C7d78tJTM+jEETaTkTT08w== X-Received: by 2002:a1c:4b19:: with SMTP id y25mr7612860wma.70.1585571644125; Mon, 30 Mar 2020 05:34:04 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id n186sm20346573wme.25.2020.03.30.05.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 05:34:03 -0700 (PDT) Date: Mon, 30 Mar 2020 14:34:02 +0200 From: Michal Hocko To: Anshuman Khandual Cc: linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Dan Williams , Pavel Tatashin , linux-kernel@vger.kernel.org Subject: Re: [RFC] mm/page_alloc: Enumerate bad page reasons Message-ID: <20200330123402.GI14243@dhcp22.suse.cz> References: <1585551097-27283-1-git-send-email-anshuman.khandual@arm.com> <20200330084300.GC14243@dhcp22.suse.cz> <689b594f-c18a-4131-8049-ac917345099b@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <689b594f-c18a-4131-8049-ac917345099b@arm.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 30-03-20 17:55:14, Anshuman Khandual wrote: > > > On 03/30/2020 02:13 PM, Michal Hocko wrote: > > On Mon 30-03-20 12:21:37, Anshuman Khandual wrote: > >> Enumerate all existing bad page reasons which can be used in bad_page() for > >> reporting via __dump_page(). Unfortunately __dump_page() cannot be changed. > >> __dump_page() is called from dump_page() that accepts a raw string and is > >> also an exported symbol that is currently being used from various generic > >> memory functions and other drivers. This reduces code duplication while > >> reporting bad pages. > > > > I dunno. It sounds like over engineering something that is an internal > > stuff. Besides that I consider string reasons kinda obvious and I am > > pretty sure I would have to check them for each numeric alias when want > > to read the code. Yeah, yeah, nothing really hard but still... > > Right these are very much self explanatory. Would moving these aliases into > mm/page_alloc.c itself, make it any better for quicker access ? Not really. Cscopes doesn't really care where it is. It is the fact that the constant makes to have a look is what makes this not an improvement from my POV. > > So I am not really sure this is all worth the code churn. Besides > > I understand but is not just repeating the same strings in similar functions > bit suboptimal as well. I do not really see why that would be suboptimal. -- Michal Hocko SUSE Labs