Received: by 10.223.176.5 with SMTP id f5csp1994410wra; Sun, 4 Feb 2018 17:42:42 -0800 (PST) X-Google-Smtp-Source: AH8x225KgsIz5PPl46iVZ224c60+dNT+EH//PI7MUFX1+s4Meiban1rCanOF5mib+pExqr/8Guvv X-Received: by 10.98.76.137 with SMTP id e9mr2042641pfj.160.1517794962842; Sun, 04 Feb 2018 17:42:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517794962; cv=none; d=google.com; s=arc-20160816; b=GDdMLW5jSJHWmmBtB9hR5xdtgwAnT/7vqfkD3PynK3HFFh8bnYUALOPDKsmxF1mOT/ F1Yz/70NTfeKZm+Yrro9/z35HfNYPWghBSQ/+q7R0VxKPHL76Ezn03P98sRRmcMdSF9w Agj70+LHlLguzu8pv4hvUlDY3bZhE6rZitSYa+ONsAZpvhSpyuojj9H2VC5awR/cfF+W Ay3pzRVMFUU3o/JqgIALOwqt5aPA9UiAEXiu4H5ZTB+1nCCWa8eR9dP2VqecJboJ7IFy 1dcOza8sKeCUBneNpkG91028APdeI01TU/eLj6ppBpR7xvC666tAw4+7uG6sqihb5OXz W5Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=hCZcr2jr6xU2I3d8ee1PdfSmBs/sSRBRjx4kGKDEil0=; b=GWs2AmYZ/Yum1R0eeIH6m7emo2pwd1P0h9E7c41ZLIz7fG/TUS1eO7nL+VETvYooUO 9oZ6aCqc99+HOO3iAZZ1g/68GRcjyywv0Az361YwnX8ztCI7sSnAHZUTgHcY5KN4UIIf a4sV1DR4k9goRrYW0rJFVAAIk87J+AnRpXLjHv+NS8ysKTLNPj8MNkDw/E6IyC6v0Q9t FM1nUbrnrbC3EAHiPgi9a3mUiwf8SpRKlHOEGNDq9gv1xF53Uxk/atZacigL7UqHiait nR0MWlbt/tAOCyR6REeRslPhOXsbFDwBu6NFZhQ8emAmGaO2aE4TACoyWcMZjfVutt8u RCqw== 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 z10si3206497pgo.495.2018.02.04.17.42.28; Sun, 04 Feb 2018 17:42:42 -0800 (PST) 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 S1752807AbeBEBlX (ORCPT + 99 others); Sun, 4 Feb 2018 20:41:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:44112 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752669AbeBEB2W (ORCPT ); Sun, 4 Feb 2018 20:28:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6613EADF0; Mon, 5 Feb 2018 01:28:00 +0000 (UTC) From: Davidlohr Bueso To: akpm@linux-foundation.org, mingo@kernel.org Cc: peterz@infradead.org, ldufour@linux.vnet.ibm.com, jack@suse.cz, mhocko@kernel.org, kirill.shutemov@linux.intel.com, mawilcox@microsoft.com, mgorman@techsingularity.net, dave@stgolabs.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/64] mm: huge pagecache: do not check mmap_sem state Date: Mon, 5 Feb 2018 02:27:13 +0100 Message-Id: <20180205012754.23615-24-dbueso@wotan.suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180205012754.23615-1-dbueso@wotan.suse.de> References: <20180205012754.23615-1-dbueso@wotan.suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Davidlohr Bueso *THIS IS A HACK* By dropping the rwsem_is_locked checks in zap_pmd_range() and zap_pud_range() we can avoid having to teach file_operations about mmrange. For example in xfs: iomap_dio_rw() is called by .read_iter file callbacks. No-Yet-Signed-off-by: Davidlohr Bueso --- mm/memory.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 7c69674cd9da..598a8c69e3d3 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1422,8 +1422,6 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb, next = pmd_addr_end(addr, end); if (is_swap_pmd(*pmd) || pmd_trans_huge(*pmd) || pmd_devmap(*pmd)) { if (next - addr != HPAGE_PMD_SIZE) { - VM_BUG_ON_VMA(vma_is_anonymous(vma) && - !rwsem_is_locked(&tlb->mm->mmap_sem), vma); __split_huge_pmd(vma, pmd, addr, false, NULL); } else if (zap_huge_pmd(tlb, vma, pmd, addr)) goto next; @@ -1459,7 +1457,6 @@ static inline unsigned long zap_pud_range(struct mmu_gather *tlb, next = pud_addr_end(addr, end); if (pud_trans_huge(*pud) || pud_devmap(*pud)) { if (next - addr != HPAGE_PUD_SIZE) { - VM_BUG_ON_VMA(!rwsem_is_locked(&tlb->mm->mmap_sem), vma); split_huge_pud(vma, pud, addr); } else if (zap_huge_pud(tlb, vma, pud, addr)) goto next; -- 2.13.6