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] [day] [month] [year] [list]
Message-ID: <c5dc155f-a53f-dd8c-86a2-c59e0839314b@huawei.com>
Date:   Mon, 27 Mar 2023 09:22:36 +0800
From:   Liu Shixin <liushixin2@...wei.com>
To:     Christoph Hellwig <hch@....de>,
        Sergey Senozhatsky <senozhatsky@...omium.org>
CC:     Seth Jennings <sjenning@...hat.com>,
        Dan Streetman <ddstreet@...e.org>,
        Vitaly Wool <vitaly.wool@...sulko.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Nathan Chancellor <nathan@...nel.org>,
        <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
Subject: Re: [PATCH -next v7 2/4] mm/zswap: skip invalid or unchanged
 parameter



On 2023/3/27 7:25, Christoph Hellwig wrote:
> On Sun, Mar 26, 2023 at 01:53:27PM +0900, Sergey Senozhatsky wrote:
>>>> +	if (kstrtobool(val, &res))
>>>> +		return -EINVAL;
>>>> +
>>>> +	/* no change required */
>>>> +	if (res == *(bool *)kp->arg)
>>>> +		return 0;
>>> Bool kernel param can be any of these letters 'YyTt1NnFf0'. Doing things
>>> to kp->arg outside of kernel/params.c is not going to be easy, let's not
>>> even try.
>> Please disregard my previous email. kp->arg is always true or false
>> at this point. I'd still prefer to not do kp->arg in zswap.
> The whole parameter handling in zswap is a mess and I don't really
> have a good idea how to solve it all.
>
> But for this "paramter not changed" case I think we can helper a lot
> by adding a core moduleparam.h helper to encapsule it.  I.e.:
>
> static inline bool param_bool_unchanged(bool val,
> 		const struct kernel_param *kp)
>
> 	return val == *(bool *)kp->arg);
> }
>
> and at least keep it out of zswap.
Thanks for your advice. I will try this way.
>
> .
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ