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:   Fri,  6 Aug 2021 11:47:11 +0000
From:   SeongJae Park <sj38.park@...il.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     SeongJae Park <sj38.park@...il.com>,
        SeongJae Park <sjpark@...zon.de>, Jonathan.Cameron@...wei.com,
        acme@...nel.org, alexander.shishkin@...ux.intel.com,
        amit@...nel.org, benh@...nel.crashing.org,
        brendanhiggins@...gle.com, corbet@....net, david@...hat.com,
        dwmw@...zon.com, elver@...gle.com, fan.du@...el.com,
        foersleo@...zon.de, greg@...ah.com, gthelen@...gle.com,
        guoju.fgj@...baba-inc.com, jgowans@...zon.com, joe@...ches.com,
        mgorman@...e.de, mheyne@...zon.de, minchan@...nel.org,
        mingo@...hat.com, namhyung@...nel.org, peterz@...radead.org,
        riel@...riel.com, rientjes@...gle.com, rostedt@...dmis.org,
        rppt@...nel.org, shakeelb@...gle.com, shuah@...nel.org,
        sieberf@...zon.com, snu@...le79.org, vbabka@...e.cz,
        vdavydov.dev@...il.com, zgf574564920@...il.com,
        linux-damon@...zon.com, linux-mm@...ck.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v34 07/13] mm/damon: Implement a debugfs-based user space interface

From: SeongJae Park <sjpark@...zon.de>

On Thu, 5 Aug 2021 17:43:16 -0700 Andrew Morton <akpm@...ux-foundation.org> wrote:

> On Fri, 16 Jul 2021 08:14:43 +0000 SeongJae Park <sj38.park@...il.com> wrote:
> 
> > +#define targetid_is_pid(ctx)	\
> > +	(ctx->primitive.target_valid == damon_va_target_valid)
> > +
> 
> I think this can be implemented as a static inline C function?
> 
> --- a/mm/damon/dbgfs.c~mm-damon-implement-a-debugfs-based-user-space-interface-fix-fix
> +++ a/mm/damon/dbgfs.c
> @@ -97,8 +97,10 @@ out:
>  	return ret;
>  }
>  
> -#define targetid_is_pid(ctx)	\
> -	(ctx->primitive.target_valid == damon_va_target_valid)
> +static inline bool targetid_is_pid(const struct damon_ctx *ctx)
> +{
> +	return ctx->primitive.target_valid == damon_va_target_valid;
> +}
>  
>  static ssize_t sprint_target_ids(struct damon_ctx *ctx, char *buf, ssize_t len)
>  {
> 
> We prefer this because it looks better, provides typechecking and can
> in some situations suppress unused variable warnings.

Agreed, I will keep that preference in my mind.  I also found that you already
nicely made the change in the the -mm tree[1], appreciate!

[1] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-damon-implement-a-debugfs-based-user-space-interface-fix-fix.patch


Thanks,
SeongJae Park

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ