From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752146AbcDPX3y (ORCPT ); Sat, 16 Apr 2016 19:29:54 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35709 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbcDPX3w (ORCPT ); Sat, 16 Apr 2016 19:29:52 -0400 Date: Sat, 16 Apr 2016 16:29:44 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: "Kirill A. Shutemov" , Andrea Arcangeli , Andres Lagar-Cavilla , Yang Shi , Ning Qu , Stephen Rothwell , kbuild test robot , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH mmotm 2/5] huge tmpfs: fix mlocked meminfo track huge unhuge mlocks fix In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please add this fix after huge-tmpfs-fix-mlocked-meminfo-track-huge-unhuge-mlocks.patch for later merging into it. I expect this to fix a build problem found by robot on an x86_64 randconfig. I was not able to reproduce the error, but I'm growing to realize that different optimizers behave differently. Reported-by: kbuild test robot Signed-off-by: Hugh Dickins --- mm/rmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1445,8 +1445,12 @@ static int try_to_unmap_one(struct page */ if (!(flags & TTU_IGNORE_MLOCK)) { if (vma->vm_flags & VM_LOCKED) { + int nr_pages = 1; + + if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && !pte) + nr_pages = HPAGE_PMD_NR; /* Holding pte lock, we do *not* need mmap_sem here */ - mlock_vma_pages(page, pte ? 1 : HPAGE_PMD_NR); + mlock_vma_pages(page, nr_pages); ret = SWAP_MLOCK; goto out_unmap; }