lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200818065817.GI28270@dhcp22.suse.cz>
Date:   Tue, 18 Aug 2020 08:58:17 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Anshuman Khandual <anshuman.khandual@....com>
Cc:     linux-mm@...ck.org, akpm@...ux-foundation.org,
        David Hildenbrand <david@...hat.com>,
        Dan Williams <dan.j.williams@...el.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hotplug: Enumerate memory range offlining failure
 reasons

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ