From patchwork Fri May 20 21:16:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12857451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03F48C433EF for ; Fri, 20 May 2022 21:16:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F53D6B0074; Fri, 20 May 2022 17:16:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A5DE6B0075; Fri, 20 May 2022 17:16:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 444746B0078; Fri, 20 May 2022 17:16:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 346216B0074 for ; Fri, 20 May 2022 17:16:19 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 0FF086011C for ; Fri, 20 May 2022 21:16:19 +0000 (UTC) X-FDA: 79487379678.12.485651D Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by imf25.hostedemail.com (Postfix) with ESMTP id 724FDA0017 for ; Fri, 20 May 2022 21:15:53 +0000 (UTC) Received: by mail-pg1-f180.google.com with SMTP id t28so1130919pga.6 for ; Fri, 20 May 2022 14:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CWTSuBzkkT6cGFJIErCii42a5cTy6mj6tu0MEYBpYuw=; b=iGY0yXmtNOFzXqS3vyE8ZWNBhizNBWAbJa2rbH/Vkpzz7T3dDYF9Ol/pbh9S0aT/QO XAqSSTx79FNGM4luPdcTV/Iog4IgdOeHuLsBRaztYmtCMFvj43q1Ue3PA3TBcvLNo5/b vrpVPdbVgaIWH2tZoEFXRgwC8mh2vx6y6OO60N5j6CIvFX1tPqUnOEKRfunPOQr3b0qx FYZjBYPOpKz0LwrsaPFfj7T6567Q+Uik2rhKsrGy8XHJ9+2YtpcJW74Hzu54nURexFHm Bw55LeG5STs7fGwFdmdV3yvrAj0nfoJXzQgEZ/nVABaILAVfFB7HsmDEHYaYhfUATFlZ oyVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CWTSuBzkkT6cGFJIErCii42a5cTy6mj6tu0MEYBpYuw=; b=Dnej8gKYOq8Y6wXIrljekqCP1zSOLg5zhdTcLUcx2EiV6l0SzGzv+wo1ugqT92ut6T 9WMyjB3jvvLTwcLjYHqIW48iNkOgk7PtYzw78oEjE13ju+z3BYPONdnfWKz2R2iayjR/ Opx1o23qjIvKvpZzegdVkGfCxurZAC4Y4GYyU/Jat3lxV2XVdIHayxdZFh9yV3md8Jst oBzJK+HAdZQQnYalDQ9X+j5TNPZB+loBgNtb5/xgjdqweR2/fG6pdAAK8xAbckYI9PYW YQk40n5gPEdPShDWvDnKThYuiqtUHh+bwRzh4Wi0Vn70q4hrw9R5sBJw7xnE8i3Zmua6 jxNA== X-Gm-Message-State: AOAM532GgpVuDWpCqv2GAEUprbNaWnG6Bqs4vnRfuyyjzyD6CRqXka/6 6TGO5FDx3iEpVOyMlN7o8BCpojL8uIs= X-Google-Smtp-Source: ABdhPJzR7VPOsIaHO4OZTJQpRymr7nffns8nLDPr1XGwHxgbnuzrVAXgs8g9ePKP8oLouCW6W3jqvA== X-Received: by 2002:a05:6a00:1c76:b0:510:8b76:93b5 with SMTP id s54-20020a056a001c7600b005108b7693b5mr12027301pfw.44.1653081376489; Fri, 20 May 2022 14:16:16 -0700 (PDT) Received: from localhost.localdomain (c-67-174-241-145.hsd1.ca.comcast.net. [67.174.241.145]) by smtp.gmail.com with ESMTPSA id h1-20020a170902748100b0015e8d4eb2c2sm167620pll.268.2022.05.20.14.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 14:16:15 -0700 (PDT) From: Yang Shi To: vbabka@suse.cz, kirill.shutemov@linux.intel.com, akpm@linux-foundation.org Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] mm: khugepaged: remove the redundant anon vma check Date: Fri, 20 May 2022 14:16:01 -0700 Message-Id: <20220520211605.51473-4-shy828301@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20220520211605.51473-1-shy828301@gmail.com> References: <20220520211605.51473-1-shy828301@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 724FDA0017 X-Stat-Signature: 73kahoihognjnarnmp6jdyca86k9iphs Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iGY0yXmt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf25.hostedemail.com: domain of shy828301@gmail.com designates 209.85.215.180 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspam-User: X-HE-Tag: 1653081353-883352 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 hugepage_vma_check() already checked it, so remove the redundant check. Signed-off-by: Yang Shi --- mm/khugepaged.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 5bdb30a76f05..4fe1dd3d8ef4 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -966,9 +966,6 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, return SCAN_ADDRESS_RANGE; if (!hugepage_vma_check(vma, vma->vm_flags)) return SCAN_VMA_CHECK; - /* Anon VMA expected */ - if (!vma->anon_vma || !vma_is_anonymous(vma)) - return SCAN_VMA_CHECK; return 0; }