From patchwork Fri Mar 27 20:00:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 11463057 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 EE3BA81 for ; Fri, 27 Mar 2020 20:00:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BB6BB20714 for ; Fri, 27 Mar 2020 20:00:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="WuL3sUI3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB6BB20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B0FD76B0072; Fri, 27 Mar 2020 16:00:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A951E6B0073; Fri, 27 Mar 2020 16:00:35 -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 983CB6B0074; Fri, 27 Mar 2020 16:00:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 7F0616B0072 for ; Fri, 27 Mar 2020 16:00:35 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 3C745824805A for ; Fri, 27 Mar 2020 20:00:35 +0000 (UTC) X-FDA: 76642209630.04.limit41_2230bfb29b230 X-Spam-Summary: 2,0,0,08bdca79139bc454,d41d8cd98f00b204,jgg@ziepe.ca,,RULES_HIT:41:355:379:541:800:960:968:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3871:4419:5007:6120:6261:6653:7576:7808:7901:10004:11026:11473:11658:11914:12043:12114:12295:12296:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13311:13357:13894:14181:14384:14394:14721:21080:21444:21451:21627:21990:30012:30054:30064,0,RBL:209.85.219.65:@ziepe.ca:.lbl8.mailshell.net-66.100.201.201 62.2.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: limit41_2230bfb29b230 X-Filterd-Recvd-Size: 4823 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 20:00:34 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id t4so1353952qvz.8 for ; Fri, 27 Mar 2020 13:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9QoBL2elXCgBQYfLUofWPZ+WlaBKVcEFC/RukhDLmrw=; b=WuL3sUI3tbw/U0XG7NWMDd1WUeDaBUsogCrq7+FDuRkAbsrKV82rHP4vcJwfLkF2gg 7RFowYXUucT+ro5VSC9QSk0FrDwJabuexGQSPqng1BwqiZzp2un/0xDQ2mk5Knu6XEkh LbUoPopLvqKJ+0wumG9i0lhmsK01rb8n+mS19r2NwNP7c0uB5g2vLSXjwzZjvwxNWWUo kSLlfGN3HEmGqe58GdPkfi1QlPKBCxRJRBDQmZ1S+Q0BjI1a4SOjbGTjECQO+gcGk6mH lXiJMw3Qwp+Kt00yXEuxFp2hlnG7TKcI78dnI10wbTpfjf8nVZVas3N7BcXJPe63KZTC fcGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9QoBL2elXCgBQYfLUofWPZ+WlaBKVcEFC/RukhDLmrw=; b=KJx5W5qzF5d3IXNGmxja5OQHA4gHv3TM69MwT3sMwqBrABcOOKs6oaPjZCtKK5nAP0 Uom4OsTb9GIBhsRt5PUlRqen+m0vBZuTKxcpTJo3dZBqUZVKpH/4sll63/XO+TIWflQe zceoLJMrAvjtBuVPt6A5BauQttkX+C/pbz7m+ASMtwulJGYEhbRkyhsKvP36EkdW/3I6 09GNSRRA/aFvRewUomTI71X/9xPP/EL/svtOCg2Jmnc8/xAkjojRVTDDHQiy+yu+IEgi +eEj7A9qd000/I6sL0/PnpbUZW0VFT3wDAR4HzFaoNn3JygprkdQrJ+NyTE9iNhoxA4W ++SQ== X-Gm-Message-State: ANhLgQ0DIPEJrnVwUrs3RM6OTr8M4tS3Cx+Z5Vju4nACJb+p1cmSQerm mFbJf1sShQsmYzDt5B8Yzdza9w== X-Google-Smtp-Source: ADFU+vsJyJRZmZ5TMEYNXYMMzAdCRdRiK4gIWxEwhTOBgyVY+Pj2x550WvJcZ6da79IK6DKEnEHegw== X-Received: by 2002:ad4:43c1:: with SMTP id o1mr963932qvs.56.1585339234373; Fri, 27 Mar 2020 13:00:34 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id o81sm4515430qke.24.2020.03.27.13.00.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 13:00:27 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jHv9V-0007fs-5I; Fri, 27 Mar 2020 17:00:25 -0300 From: Jason Gunthorpe To: Jerome Glisse , Ralph Campbell , Felix.Kuehling@amd.com Cc: linux-mm@kvack.org, John Hubbard , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Philip Yang , Jason Gunthorpe Subject: [PATCH v2 hmm 5/9] mm/hmm: remove the CONFIG_TRANSPARENT_HUGEPAGE #ifdef Date: Fri, 27 Mar 2020 17:00:17 -0300 Message-Id: <20200327200021.29372-6-jgg@ziepe.ca> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200327200021.29372-1-jgg@ziepe.ca> References: <20200327200021.29372-1-jgg@ziepe.ca> MIME-Version: 1.0 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: From: Jason Gunthorpe This code can be compiled when CONFIG_TRANSPARENT_HUGEPAGE is off, so remove the ifdef. The function is only ever called under if (pmd_devmap(pmd) || pmd_trans_huge(pmd)) Which is statically false if !CONFIG_TRANSPARENT_HUGEPAGE, so the compiler reliably eliminates all of this code. Reviewed-by: Ralph Campbell Reviewed-by: Christoph Hellwig Tested-by: Ralph Campbell Signed-off-by: Jason Gunthorpe --- mm/hmm.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/hmm.c b/mm/hmm.c index 8dbd9e1d0308b4..3a71ec72b0a42f 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -193,7 +193,6 @@ static inline uint64_t pmd_to_hmm_pfn_flags(struct hmm_range *range, pmd_t pmd) range->flags[HMM_PFN_VALID]; } -#ifdef CONFIG_TRANSPARENT_HUGEPAGE static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, unsigned long end, uint64_t *pfns, pmd_t pmd) { @@ -216,11 +215,6 @@ static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, hmm_vma_walk->last = end; return 0; } -#else /* CONFIG_TRANSPARENT_HUGEPAGE */ -/* stub to allow the code below to compile */ -int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, - unsigned long end, uint64_t *pfns, pmd_t pmd); -#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ static inline bool hmm_is_device_private_entry(struct hmm_range *range, swp_entry_t entry)