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]
Date:   Mon, 13 Jun 2022 13:33:52 +0800
From:   Ying Huang <ying.huang@...el.com>
To:     Aneesh Kumar K V <aneesh.kumar@...ux.ibm.com>, linux-mm@...ck.org,
        akpm@...ux-foundation.org
Cc:     Wei Xu <weixugc@...gle.com>, Greg Thelen <gthelen@...gle.com>,
        Yang Shi <shy828301@...il.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Tim C Chen <tim.c.chen@...el.com>,
        Brice Goglin <brice.goglin@...il.com>,
        Michal Hocko <mhocko@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Hesham Almatary <hesham.almatary@...wei.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Alistair Popple <apopple@...dia.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Feng Tang <feng.tang@...el.com>,
        Jagdish Gediya <jvgediya@...ux.ibm.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH v6 03/13] mm/demotion: Return error on write to
 numa_demotion sysfs

On Mon, 2022-06-13 at 09:05 +0530, Aneesh Kumar K V wrote:
> On 6/13/22 8:56 AM, Ying Huang wrote:
> > On Fri, 2022-06-10 at 19:22 +0530, Aneesh Kumar K.V wrote:
> > > With CONFIG_MIGRATION disabled return EINVAL on write.
> > > 
> > > Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.ibm.com>
> > > ---
> > >   mm/memory-tiers.c | 3 +++
> > >   1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
> > > index 9c6b40d7e0bf..c3123a457d90 100644
> > > --- a/mm/memory-tiers.c
> > > +++ b/mm/memory-tiers.c
> > > @@ -105,6 +105,9 @@ static ssize_t numa_demotion_enabled_store(struct kobject *kobj,
> > >   {
> > >   	ssize_t ret;
> > >   
> > > 
> > > 
> > > +	if (!IS_ENABLED(CONFIG_MIGRATION))
> > > +		return -EINVAL;
> > > +
> > 
> > How about enclose numa_demotion_enabled_xxx related code with CONFIG_MIGRATION?
> > 
> 
> IIUC there is a desire to use IS_ENABLED() in the kernel instead of 
> #ifdef since that helps in more compile time checks. Because there are 
> no dead codes during compile now with IS_ENABLED().

IS_ENABLED() is used to reduce usage of "#ifdef" in ".c" file,
especially inside a function.  We have good build test coverage with
0Day now.

To avoid code size inflate, it's better to use #ifdef CONFIG_MIGRATION.

> W.r.t leaving the sysfs file visible even when CONFIG_MIGRATION is 
> disabled, I was thinking it gives better visibility into numa_demotion 
> status. I could switch to hide numa_demotion file if that is desirable.
> 
> > >   	ret = kstrtobool(buf, &numa_demotion_enabled);
> > >   	if (ret)
> > >   		return ret;
> > 

Best Regards,
Huang, Ying

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ