Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383802

Re: [PATCH mmotm 3/5] huge tmpfs recovery: tweak shmem_getpage_gfp to fill team fix

From Stephen Rothwell <sfr@canb.auug.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH mmotm 3/5] huge tmpfs recovery: tweak shmem_getpage_gfp to fill team fix
Date 2016-04-21 02:00 +0200
Message-ID <rqaci-7W7-3@gated-at.bofh.it> (permalink)
References <roHP4-30O-1@gated-at.bofh.it> <roHYJ-35i-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Hugh,

On Sat, 16 Apr 2016 16:33:07 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:
>
> Please add this fix after my 27/31, your
> huge-tmpfs-recovery-tweak-shmem_getpage_gfp-to-fill-team.patch
> for later merging into it.  Great catch by Mika Penttila, a bug which
> prevented some unusual cases from being recovered into huge pages as
> intended: an initially sparse head would be set PageTeam only after
> this check.  But the check is guarding against a racing disband, which
> cannot happen before the head is published as PageTeam, plus we have
> an additional reference on the head which keeps it safe throughout:
> so very easily fixed.
> 
> Reported-by: Mika Penttila <mika.penttila@nextfour.com>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
>  mm/shmem.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -2938,7 +2938,7 @@ repeat:
>  			page = *pagep;
>  			lock_page(page);
>  			head = page - (index & (HPAGE_PMD_NR-1));
> -			if (!PageTeam(head)) {
> +			if (!PageTeam(head) && page != head) {
>  				error = -ENOENT;
>  				goto decused;
>  			}

Added to linux-next today.

-- 
Cheers,
Stephen Rothwell

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH mmotm 1/5] huge tmpfs: try to allocate huge pages split into  a team fix Hugh Dickins <hughd@google.com> - 2016-04-17 01:30 +0200
  [PATCH mmotm 2/5] huge tmpfs: fix mlocked meminfo track huge unhuge  mlocks fix Hugh Dickins <hughd@google.com> - 2016-04-17 01:40 +0200
    Re: [PATCH mmotm 2/5] huge tmpfs: fix mlocked meminfo track huge  unhuge mlocks fix Stephen Rothwell <sfr@canb.auug.org.au> - 2016-04-21 01:50 +0200
  [PATCH mmotm 4/5] huge tmpfs: avoid premature exposure of new  pagetable revert Hugh Dickins <hughd@google.com> - 2016-04-17 01:40 +0200
    Re: [PATCH mmotm 4/5] huge tmpfs: avoid premature exposure of new  pagetable revert Stephen Rothwell <sfr@canb.auug.org.au> - 2016-04-21 02:00 +0200
  [PATCH mmotm 3/5] huge tmpfs recovery: tweak shmem_getpage_gfp to  fill team fix Hugh Dickins <hughd@google.com> - 2016-04-17 01:40 +0200
    Re: [PATCH mmotm 3/5] huge tmpfs recovery: tweak shmem_getpage_gfp  to fill team fix Stephen Rothwell <sfr@canb.auug.org.au> - 2016-04-21 02:00 +0200
  [PATCH mmotm 5/5] huge tmpfs: add shmem_pmd_fault() Hugh Dickins <hughd@google.com> - 2016-04-17 01:50 +0200
    Re: [PATCH mmotm 5/5] huge tmpfs: add shmem_pmd_fault() "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-04-17 02:50 +0200
      Re: [PATCH mmotm 5/5] huge tmpfs: add shmem_pmd_fault() Hugh Dickins <hughd@google.com> - 2016-04-17 03:30 +0200
    Re: [PATCH mmotm 5/5] huge tmpfs: add shmem_pmd_fault() Stephen Rothwell <sfr@canb.auug.org.au> - 2016-04-21 02:00 +0200
  Re: [PATCH mmotm 1/5] huge tmpfs: try to allocate huge pages split  into a team fix Stephen Rothwell <sfr@canb.auug.org.au> - 2016-04-21 01:50 +0200

csiph-web