Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1297761imm; Fri, 27 Jul 2018 14:51:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeAI3HTfg9sm0eZ4fkKbiAFpjIBxNw8VuacJuE/m90eRWRGSso4v/E58IUXUqfwDTbXbSgr X-Received: by 2002:a63:eb0e:: with SMTP id t14-v6mr7516060pgh.198.1532728310534; Fri, 27 Jul 2018 14:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532728310; cv=none; d=google.com; s=arc-20160816; b=0qXL+d9mQ0tHcQXS33bDJJsQlgzDbSRcxEoXlSTFT4pYsStSC6JUSoRi/fHB5mmJfC a1oZkuvaFd8jP9TYZYhZYxJAeIEPr2hMKLIX2/TEXJzC/UAljbhuZFlOdhgsOLBq6cXf wBqjwAWiI2Sg4iOLzXP13PnehMynlmNk+CrrITxyc3Pt9KOlun1T2h2s6Uro25AxMYO0 V798yUV5dMhworOqi/N/hyO1oIFPIGvr7UdWMSNCgpAUQrKhMbQINK9E/vJbgipTE69n BenOVXgERco03+JZtyg2cfux1CVbOodb1CarBhMyxdj1oQmfeB9F3uQS00lVzPuxE8Db RPPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=bAr851+pwtDoUuc5upG+fX7bmqwaqTCjPstLh3iEzhs=; b=hCkUgS3kSHUGqQqj8hjf48nTUNfMDUBkBXIiyKVDHQ1ouVKYCwbwHJsSBemIEfgt9M 7UYN8YVPUOsBKSHqzndOKySWTHt1aTXnPEe+ikdE2NzlPA1kG+FGsuGpfmC/+mcYWzVw vfsTZszHK95cxKMR27BzaLleaU/HE+mKPSeO8nkQhVtCksmgiPbEPnTIjf1d7fixJIy6 SwCUSx3BL/PFRrb4PywLy4b/DKEBt4Rb0fq7myAO+MYoukLhI+tgamgFuzPBaHMSmNUk 8r3XMhwvovqfMgVCx35MqLclZW3EAXVfcrHZyzi7uocFprdPxYkyLkMTEfDPzY4m1101 m3HQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v32-v6si4439249plb.273.2018.07.27.14.51.35; Fri, 27 Jul 2018 14:51:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389847AbeG0XOB (ORCPT + 99 others); Fri, 27 Jul 2018 19:14:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36118 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389728AbeG0XOB (ORCPT ); Fri, 27 Jul 2018 19:14:01 -0400 Received: from localhost.localdomain (c-24-4-125-7.hsd1.ca.comcast.net [24.4.125.7]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BF661CBD; Fri, 27 Jul 2018 21:50:11 +0000 (UTC) Date: Fri, 27 Jul 2018 14:50:09 -0700 From: Andrew Morton To: Jane Chu Cc: dan.j.williams@intel.com, mhocko@suse.com, jack@suse.cz, jglisse@redhat.com, mike.kravetz@oracle.com, dave@stgolabs.net, linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, Hugh Dickins Subject: Re: [PATCH] ipc/shm.c add ->pagesize function to shm_vm_ops Message-Id: <20180727145009.5dde68fb680ec148a7504f37@linux-foundation.org> In-Reply-To: <20180727211727.5020-1-jane.chu@oracle.com> References: <20180727211727.5020-1-jane.chu@oracle.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Jul 2018 15:17:27 -0600 Jane Chu wrote: > Commit 05ea88608d4e13 (mm, hugetlbfs: introduce ->pagesize() to > vm_operations_struct) adds a new ->pagesize() function to > hugetlb_vm_ops, intended to cover all hugetlbfs backed files. That was merged three months ago. Can you suggest why this was only noticed now? What workload triggered this? I see no cc:stable, but 4.17 is affected? > With System V shared memory model, if "huge page" is specified, > the "shared memory" is backed by hugetlbfs files, but the mappings > initiated via shmget/shmat have their original vm_ops overwritten > with shm_vm_ops, so we need to add a ->pagesize function to shm_vm_ops. > Otherwise, vma_kernel_pagesize() returns PAGE_SIZE given a hugetlbfs > backed vma, result in below BUG: > > fs/hugetlbfs/inode.c > 443 if (unlikely(page_mapped(page))) { > 444 BUG_ON(truncate_op); OK, help me out here. How does an incorrect return value from vma_kernel_pagesize() result in remove_inode_hugepages() deciding that it's truncating a mapped page?