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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 B028BC433E1 for ; Tue, 18 Aug 2020 06:58:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6FC4520639 for ; Tue, 18 Aug 2020 06:58:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FC4520639 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DAAC18D0003; Tue, 18 Aug 2020 02:58:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5D5A6B0008; Tue, 18 Aug 2020 02:58:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C70C88D0003; Tue, 18 Aug 2020 02:58:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id B02A56B0007 for ; Tue, 18 Aug 2020 02:58:20 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 745C21DEF for ; Tue, 18 Aug 2020 06:58:20 +0000 (UTC) X-FDA: 77162785560.04.match03_370e38f2701d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 249458009E89 for ; Tue, 18 Aug 2020 06:58:20 +0000 (UTC) X-HE-Tag: match03_370e38f2701d X-Filterd-Recvd-Size: 2629 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Aug 2020 06:58:19 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 03703AD12; Tue, 18 Aug 2020 06:58:44 +0000 (UTC) Date: Tue, 18 Aug 2020 08:58:17 +0200 From: Michal Hocko To: Anshuman Khandual Cc: linux-mm@kvack.org, akpm@linux-foundation.org, David Hildenbrand , Dan Williams , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/hotplug: Enumerate memory range offlining failure reasons Message-ID: <20200818065817.GI28270@dhcp22.suse.cz> References: <1597724522-31545-1-git-send-email-anshuman.khandual@arm.com> <20200818060547.GH28270@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 249458009E89 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 Tue 18-08-20 11:58:49, Anshuman Khandual wrote: > > > On 08/18/2020 11:35 AM, Michal Hocko wrote: > > On Tue 18-08-20 09:52:02, Anshuman Khandual wrote: > >> Currently a debug message is printed describing the reason for memory range > >> offline failure. This just enumerates existing reason codes which improves > >> overall readability and makes it cleaner. This does not add any functional > >> change. > > > > Wasn't something like that posted already? To be honest I do not think > > There was a similar one regarding bad page reason. > > https://patchwork.kernel.org/patch/11464713/ > > > this is worth the additional LOC. We are talking about few strings used > > at a single place. I really do not see any simplification, constants are > > sometimes even longer than the strings they are describing. > > I am still trying to understand why enumerating all potential offline > failure reasons in a single place (i.e via enum) is not a better idea > than strings scattered across the function. Besides being cleaner, it > classifies, organizes and provide a structure to the set of reasons. > It is not just about string replacement with constants. This is a matter of taste. I would agree that using constants to reference standardized messages is a good idea but all these reasons are just an ad-hoc messages that we want to print more or less as a debugging output. So all the additional LOC don't really seem worth it. -- Michal Hocko SUSE Labs