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:   Wed, 29 Mar 2017 12:57:22 -0400
From:   Johannes Weiner <hannes@...xchg.org>
To:     "Huang, Ying" <ying.huang@...el.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org,
        Andrea Arcangeli <aarcange@...hat.com>,
        "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
        Vladimir Davydov <vdavydov@...tuozzo.com>,
        Michal Hocko <mhocko@...nel.org>, Tejun Heo <tj@...nel.org>,
        cgroups@...r.kernel.org
Subject: Re: [PATCH -mm -v7 2/9] mm, memcg: Support to charge/uncharge
 multiple swap entries

On Tue, Mar 28, 2017 at 01:32:02PM +0800, Huang, Ying wrote:
> @@ -5908,16 +5907,19 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
>  		css_put(&memcg->css);
>  }
>  
> -/*
> - * mem_cgroup_try_charge_swap - try charging a swap entry
> +/**
> + * mem_cgroup_try_charge_swap - try charging a set of swap entries
>   * @page: page being added to swap
> - * @entry: swap entry to charge
> + * @entry: the first swap entry to charge
> + * @nr_entries: the number of swap entries to charge
>   *
> - * Try to charge @entry to the memcg that @page belongs to.
> + * Try to charge @nr_entries swap entries starting from @entry to the
> + * memcg that @page belongs to.
>   *
>   * Returns 0 on success, -ENOMEM on failure.
>   */
> -int mem_cgroup_try_charge_swap(struct page *page, swp_entry_t entry)
> +int mem_cgroup_try_charge_swap(struct page *page, swp_entry_t entry,
> +			       unsigned int nr_entries)

I've pointed this out before, but there doesn't seem to be a reason to
pass @nr_entries when we have the struct page. Why can't this function
just check PageTransHuge() by itself?

Powered by blists - more mailing lists