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]
Message-ID: <20180612120547.njpz73dymeru5mzy@ca-dmjordan1.us.oracle.com>
Date:   Tue, 12 Jun 2018 05:05:47 -0700
From:   Daniel Jordan <daniel.m.jordan@...cle.com>
To:     "Huang, Ying" <ying.huang@...el.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Michal Hocko <mhocko@...e.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Shaohua Li <shli@...nel.org>, Hugh Dickins <hughd@...gle.com>,
        Minchan Kim <minchan@...nel.org>,
        Rik van Riel <riel@...hat.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
        Zi Yan <zi.yan@...rutgers.edu>
Subject: Re: [PATCH -mm -V3 03/21] mm, THP, swap: Support PMD swap mapping in
 swap_duplicate()

On Tue, Jun 12, 2018 at 11:15:28AM +0800, Huang, Ying wrote:
> "Huang, Ying" <ying.huang@...el.com> writes:
> >> On Wed, May 23, 2018 at 04:26:07PM +0800, Huang, Ying wrote:
> >>> @@ -3516,11 +3512,39 @@ static int __swap_duplicate(swp_entry_t entry, unsigned char usage)
> >>
> >> Two comments about this part of __swap_duplicate as long as you're moving it to
> >> another function:
> >>
> >>    } else if (count || has_cache) {
> >>    
> >>    	if ((count & ~COUNT_CONTINUED) < SWAP_MAP_MAX)          /* #1   */
> >>    		count += usage;
> >>    	else if ((count & ~COUNT_CONTINUED) > SWAP_MAP_MAX)     /* #2   */
> >>    		err = -EINVAL;
> >>
> >> #1:  __swap_duplicate_locked might use
> >>
> >>     VM_BUG_ON(usage != SWAP_HAS_CACHE && usage != 1);
> >>
> >> to document the unstated assumption that usage is 1 (otherwise count could
> >> overflow).
> >
> > Sounds good.  Will do this.
> 
> Found usage parameter of __swap_duplicate() could be SWAP_MAP_SHMEM too.
> We can improve the parameter checking.  But that appears not belong to
> this series.

Fair enough, I'll see about adding this along with the other patch I'm sending.

Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ