Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D0FC18E5B for ; Mon, 16 Mar 2020 13:59:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4898C20575 for ; Mon, 16 Mar 2020 13:59:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Rjn+zQdR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4898C20575 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB8036B0003; Mon, 16 Mar 2020 09:59:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E68886B0005; Mon, 16 Mar 2020 09:59:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D7DDA6B0007; Mon, 16 Mar 2020 09:59:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id BC4E46B0003 for ; Mon, 16 Mar 2020 09:59:52 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5B947C5B0 for ; Mon, 16 Mar 2020 13:59:52 +0000 (UTC) X-FDA: 76601383824.03.fang75_1be551c6b0a4c X-HE-Tag: fang75_1be551c6b0a4c X-Filterd-Recvd-Size: 3640 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 13:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=g1DSbAAQgLqu05AnhztbG27v8Z/3NkZnzOKspEI5T/g=; b=Rjn+zQdRJyDv4jtcAF1kF84ZYb HrdruvnxjzmY43A3u7vR+lAl5iRTEZ5CNZTnruPv9UidezdpZxv9XSimQNdIuAVonVKnB8JWCa0Si y1cW16m2xEI3VeWYkWOqdIjhI86kDh2eh2fzsnrevD3R23KMLM69XjxudmfEsU6V2Cc6a++WMEzVR JRmVm4yWZCAJl0bhVQoZYd9uwk2H7e5nsNFFOXQjQROGR/uO+IG4w3P1ajORFsK0JmWpQhvs9CJQR 8zcAFGkN3a2wGYtYGFyHsLJalSPrs7FCAqAM7ky/1GUA5OWs+C5sImPILi6ioLO8ZXd7676mGDEDo GUtuPjiw==; Received: from 089144202225.atnat0011.highway.a1.net ([89.144.202.225] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jDqHV-0001S1-R0; Mon, 16 Mar 2020 13:59:50 +0000 From: Christoph Hellwig To: Jason Gunthorpe Cc: Jerome Glisse , Ralph Campbell , linux-mm@kvack.org Subject: [PATCH 2/5] mm: remove the unused HMM_FAULT_ALLOW_RETRY flag Date: Mon, 16 Mar 2020 14:53:07 +0100 Message-Id: <20200316135310.899364-3-hch@lst.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200316135310.899364-1-hch@lst.de> References: <20200316135310.899364-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The HMM_FAULT_ALLOW_RETRY isn't used anywhere in the tree. Remove it and the weird -EAGAIN handling where handle_mm_fault drops the mmap_sem. Signed-off-by: Christoph Hellwig --- include/linux/hmm.h | 5 ----- mm/hmm.c | 7 ------- 2 files changed, 12 deletions(-) diff --git a/include/linux/hmm.h b/include/linux/hmm.h index c102e359b59d..4bf8d6997b12 100644 --- a/include/linux/hmm.h +++ b/include/linux/hmm.h @@ -217,11 +217,6 @@ static inline uint64_t hmm_device_entry_from_pfn(con= st struct hmm_range *range, range->flags[HMM_PFN_VALID]; } =20 -/* - * Retry fault if non-blocking, drop mmap_sem and return -EAGAIN in that= case. - */ -#define HMM_FAULT_ALLOW_RETRY (1 << 0) - /* Don't fault in missing PTEs, just snapshot the current state. */ #define HMM_FAULT_SNAPSHOT (1 << 1) =20 diff --git a/mm/hmm.c b/mm/hmm.c index 6d9da4b0f0a9..d7ad71d2a998 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -45,16 +45,10 @@ static int hmm_vma_do_fault(struct mm_walk *walk, uns= igned long addr, if (!vma) goto err; =20 - if (hmm_vma_walk->flags & HMM_FAULT_ALLOW_RETRY) - flags |=3D FAULT_FLAG_ALLOW_RETRY; if (write_fault) flags |=3D FAULT_FLAG_WRITE; =20 ret =3D handle_mm_fault(vma, addr, flags); - if (ret & VM_FAULT_RETRY) { - /* Note, handle_mm_fault did up_read(&mm->mmap_sem)) */ - return -EAGAIN; - } if (ret & VM_FAULT_ERROR) goto err; =20 @@ -640,7 +634,6 @@ static const struct mm_walk_ops hmm_walk_ops =3D { * -ENOMEM: Out of memory. * -EPERM: Invalid permission (e.g., asking for write and range is read * only). - * -EAGAIN: A page fault needs to be retried and mmap_sem was dropped. * -EBUSY: The range has been invalidated and the caller needs to wait f= or * the invalidation to finish. * -EFAULT: Invalid (i.e., either no valid vma or it is illegal to acces= s --=20 2.24.1