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]
Date:	Sat, 18 Oct 2014 09:57:37 -0400
From:	Dan Streetman <ddstreet@...e.org>
To:	Heesub Shin <heesub.shin@...sung.com>
Cc:	Seth Jennings <sjennings@...iantweb.net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linux-MM <linux-mm@...ck.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Sunae Seo <sunae.seo@...sung.com>
Subject: Re: [PATCH] mm/zbud: init user ops only when it is needed

On Wed, Oct 15, 2014 at 6:00 AM, Heesub Shin <heesub.shin@...sung.com> wrote:
> When zbud is initialized through the zpool wrapper, pool->ops which
> points to user-defined operations is always set regardless of whether it
> is specified from the upper layer. This causes zbud_reclaim_page() to
> iterate its loop for evicting pool pages out without any gain.
>
> This patch sets the user-defined ops only when it is needed, so that
> zbud_reclaim_page() can bail out the reclamation loop earlier if there
> is no user-defined operations specified.

Though the only current user (zswap) always passes an ops param, other
future users may not and this is the right way to handle it.  thanks!

>
> Signed-off-by: Heesub Shin <heesub.shin@...sung.com>

Acked-by: Dan Streetman <ddstreet@...e.org>

> ---
>  mm/zbud.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/zbud.c b/mm/zbud.c
> index ecf1dbe..db8de74 100644
> --- a/mm/zbud.c
> +++ b/mm/zbud.c
> @@ -132,7 +132,7 @@ static struct zbud_ops zbud_zpool_ops = {
>
>  static void *zbud_zpool_create(gfp_t gfp, struct zpool_ops *zpool_ops)
>  {
> -       return zbud_create_pool(gfp, &zbud_zpool_ops);
> +       return zbud_create_pool(gfp, zpool_ops ? &zbud_zpool_ops : NULL);
>  }
>
>  static void zbud_zpool_destroy(void *pool)
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ