From patchwork Fri Jun 12 19:26:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralph Campbell X-Patchwork-Id: 11602235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7053E618 for ; Fri, 12 Jun 2020 19:26:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3CC23206D7 for ; Fri, 12 Jun 2020 19:26:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="g3KYVEGl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CC23206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 56E958D00CE; Fri, 12 Jun 2020 15:26:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 51F428D00A0; Fri, 12 Jun 2020 15:26:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4347F8D00CE; Fri, 12 Jun 2020 15:26:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id 2C9748D00A0 for ; Fri, 12 Jun 2020 15:26:32 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E70141548A5 for ; Fri, 12 Jun 2020 19:26:31 +0000 (UTC) X-FDA: 76921541382.16.lake91_230c02a26dde Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id B786F1006A262 for ; Fri, 12 Jun 2020 19:26:31 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,rcampbell@nvidia.com,,RULES_HIT:30012:30054:30064:30070:30074,0,RBL:216.228.121.143:@nvidia.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:35,LUA_SUMMARY:none X-HE-Tag: lake91_230c02a26dde X-Filterd-Recvd-Size: 3568 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Fri, 12 Jun 2020 19:26:31 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 12 Jun 2020 12:24:55 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 12 Jun 2020 12:26:29 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 12 Jun 2020 12:26:29 -0700 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 12 Jun 2020 19:26:21 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 12 Jun 2020 19:26:21 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Fri, 12 Jun 2020 12:26:21 -0700 From: Ralph Campbell To: , CC: Jerome Glisse , John Hubbard , Christoph Hellwig , Jason Gunthorpe , "Andrew Morton" , Ralph Campbell Subject: [PATCH] mm/hmm: remove redundant check non_swap_entry() Date: Fri, 12 Jun 2020 12:26:18 -0700 Message-ID: <20200612192618.32579-1-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1591989895; bh=icsVOdgmAkRserHRvC2Osttgk9x3GM+LGacD67WObIc=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-NVConfidentiality:Content-Transfer-Encoding: Content-Type; b=g3KYVEGlWLmJzmMnSj6C5n05opBwBpp+vfJZwrSgLFHWsR7KWI6rT8AU5cWxhvuzm JPS1/JkvO9NCmbtYXaMe2RgJeWutLsLWGRskZevRYZVV49jdnd4b7pN8ocAvVJaf8r d3qvbj4rDOK2tLwPUChEILsEdEwuErcSQV5EvZpDKoXUcwCyz+qYDuGQLGpsLOFSZB IdLwRkSkKqAGF6DHgp9zjmSpyxiSWYWZbcCottT+ymYGg+ttuxA6O0tkQNFUXjWSjV gu12wA48zxIzms9WaZKThPPnRFmt8JKj20gxqbv9RxDXKoTkbmqGUp9sefjDvIUM2y A7jN80UJypEzg== X-Rspamd-Queue-Id: B786F1006A262 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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: In zap_pte_range(), the check for non_swap_entry() and is_device_private_entry() is redundant since the latter is a subset of the former. Remove the redundant check to simplify the code and for clarity. Signed-off-by: Ralph Campbell Reviewed-by: Jason Gunthorpe --- This is based on the current linux tree and is intended for Andrew's mm tree. There is no rush so it could go into 5.9 but I think it is safe enough to go into an rc after the patch is reviewed. mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index dc7f3543b1fd..bdbb4f97e7d0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1098,7 +1098,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, } entry = pte_to_swp_entry(ptent); - if (non_swap_entry(entry) && is_device_private_entry(entry)) { + if (is_device_private_entry(entry)) { struct page *page = device_private_entry_to_page(entry); if (unlikely(details && details->check_mapping)) {