linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Liu Shixin <liushixin2@huawei.com>
To: Christoph Hellwig <hch@lst.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Seth Jennings <sjenning@redhat.com>,
	Dan Streetman <ddstreet@ieee.org>,
	Vitaly Wool <vitaly.wool@konsulko.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nathan Chancellor <nathan@kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH -next v7 2/4] mm/zswap: skip invalid or unchanged parameter
Date: Mon, 27 Mar 2023 09:22:36 +0800	[thread overview]
Message-ID: <c5dc155f-a53f-dd8c-86a2-c59e0839314b@huawei.com> (raw)
In-Reply-To: <20230326232508.GB19631@lst.de>



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.
>
> .
>



  reply	other threads:[~2023-03-27  1:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25  7:14 [PATCH -next v7 0/4] Delay the initialization of zswap Liu Shixin
2023-03-25  7:14 ` [PATCH -next v7 1/4] mm/zswap: remove zswap_entry_cache_{create,destroy} helper function Liu Shixin
2023-03-26 23:19   ` Christoph Hellwig
2023-03-25  7:14 ` [PATCH -next v7 2/4] mm/zswap: skip invalid or unchanged parameter Liu Shixin
2023-03-26  3:08   ` Sergey Senozhatsky
2023-03-26  3:17   ` Sergey Senozhatsky
2023-03-26  4:53     ` Sergey Senozhatsky
2023-03-26 23:25       ` Christoph Hellwig
2023-03-27  1:22         ` Liu Shixin [this message]
2023-03-25  7:14 ` [PATCH -next v7 3/4] mm/zswap: replace zswap_init_{started/failed} with zswap_init_state Liu Shixin
2023-03-26 23:26   ` Christoph Hellwig
2023-03-25  7:14 ` [PATCH -next v7 4/4] mm/zswap: delay the initializaton of zswap Liu Shixin
2023-03-26 23:29   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c5dc155f-a53f-dd8c-86a2-c59e0839314b@huawei.com \
    --to=liushixin2@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=ddstreet@ieee.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nathan@kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=sjenning@redhat.com \
    --cc=vitaly.wool@konsulko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox