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: <CAM9Jb+hJsjSm-2JVe2JSXndif_hz03hFLvR+LjxPQUxQN+HH3A@mail.gmail.com>
Date:   Fri, 13 Nov 2020 16:10:34 +0100
From:   Pankaj Gupta <pankaj.gupta.linux@...il.com>
To:     Hui Su <sh_def@....com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Linux MM <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/page_counter: use page_counter_read in page_counter_set_max

> use page_counter_read() in page_counter_set_max().
>
> Signed-off-by: Hui Su <sh_def@....com>
> ---
>  mm/page_counter.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/page_counter.c b/mm/page_counter.c
> index b24a60b28bb0..c6860f51b6c6 100644
> --- a/mm/page_counter.c
> +++ b/mm/page_counter.c
> @@ -183,14 +183,14 @@ int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages)
>                  * the limit, so if it sees the old limit, we see the
>                  * modified counter and retry.
>                  */
> -               usage = atomic_long_read(&counter->usage);
> +               usage = page_counter_read(counter);
>
>                 if (usage > nr_pages)
>                         return -EBUSY;
>
>                 old = xchg(&counter->max, nr_pages);
>
> -               if (atomic_long_read(&counter->usage) <= usage)
> +               if (page_counter_read(counter) <= usage)
>                         return 0;
>
>                 counter->max = old;

Reviewed-by: Pankaj Gupta <pankaj.gupta@...ud.ionos.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ