From patchwork Mon Jun 6 21:44:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12871106 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 08DCAC433EF for ; Mon, 6 Jun 2022 21:44:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 995636B0075; Mon, 6 Jun 2022 17:44:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F81D6B0078; Mon, 6 Jun 2022 17:44:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6AC456B007B; Mon, 6 Jun 2022 17:44:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5AB8C6B0075 for ; Mon, 6 Jun 2022 17:44:25 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2FD22B8E for ; Mon, 6 Jun 2022 21:44:25 +0000 (UTC) X-FDA: 79549140090.25.18DF528 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf27.hostedemail.com (Postfix) with ESMTP id 6644F40063 for ; Mon, 6 Jun 2022 21:44:20 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id o6-20020a17090a0a0600b001e2c6566046so19047287pjo.0 for ; Mon, 06 Jun 2022 14:44:24 -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=TeR+saO9bGVSVDYLkT6whuJkztc98Y7uqJRw9Zwr6CA=; b=HKhirssn3eLksqebeSYrk+jXcfBxshfBpkTxjBPO9398Kqa18Cm3e71kgcZu26dIvY o6XXpciQWvJwXzV5TU9EluS5IVMmvxncZ5Mi/Vz+lQNfHrPN3rzLvi/l00C5t+Za+YHj YSPmh2kgWJ07k6J+1bq9EH3HdkCP54M7O6Vm/tRIEY34h4UfvDTYtD/vhvyQzncqUZA5 lIVQRmQhGGRj5O6xWtvnzee96vGcj+iwnnmw/OVFSsrJmnCfV4t/Ft+pb31IkLeX0FcM 9gByGWOdP6wH6PFe0kKeAl3/kjT4wP6BDTfJq8QgNMLS5uVGvXEfYFP0xTXUn4EZHlGi 7T5Q== 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=TeR+saO9bGVSVDYLkT6whuJkztc98Y7uqJRw9Zwr6CA=; b=B66EVWSQ3n7ny78JD1Ag0u0kKNPectjbtDR6arivF7UCunecsOKLDR/Oienv6oHxpS WA4lxqC5zVQZ1pRhfylf9bdpLbMRd7K7pDIN/s21prLiGlPvcfolKV1PfUrOb8vbnujE jM0A7xZArs6bRc7w04pOftduLr6tLk1E1s+JmkgPRDg/ZbPf5/9zzPEosusg7BRLtqqQ 1xa0BwWq+ONFsLmNtnp2R0HBZXx1Neos2F4DpRFMFezwOEBgkZXoJvWPnDofcKn2jv/u TLpi2hW/cKSEZnnDdsGgbErxaS6sh3s8CqpCvCzKBZOJXXTtvyKmAX6NESe5vNo0VLrM TWnQ== X-Gm-Message-State: AOAM532Xw+9PUnDptIZWOiAw63He0RK5Zfiy9jaq4KOnHwvYcDl0JBtE 0ZsjgcT1eYSFCnkbcJjRYTk= X-Google-Smtp-Source: ABdhPJx+QgadWDwD5L0qXpqeZx6oasMAo4joDNR6AQwapxgpVmCIYIAdm45+392KvIhA5+qYQ6m75A== X-Received: by 2002:a17:90b:4a90:b0:1e8:626c:e1b2 with SMTP id lp16-20020a17090b4a9000b001e8626ce1b2mr13173095pjb.141.1654551863738; Mon, 06 Jun 2022 14:44:23 -0700 (PDT) Received: from localhost.biz ([8.25.197.27]) by smtp.gmail.com with ESMTPSA id a4-20020a170903100400b0016397da033csm10881675plb.62.2022.06.06.14.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 14:44:23 -0700 (PDT) From: Yang Shi To: vbabka@suse.cz, kirill.shutemov@linux.intel.com, willy@infradead.org, akpm@linux-foundation.org Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [v3 PATCH 3/7] mm: khugepaged: remove the redundant anon vma check Date: Mon, 6 Jun 2022 14:44:10 -0700 Message-Id: <20220606214414.736109-4-shy828301@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20220606214414.736109-1-shy828301@gmail.com> References: <20220606214414.736109-1-shy828301@gmail.com> MIME-Version: 1.0 X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HKhirssn; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of shy828301@gmail.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=shy828301@gmail.com X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 6644F40063 X-Stat-Signature: bbfu69kq19sgo8k651jt4zyz9htyunb5 X-HE-Tag: 1654551860-624881 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 d0f8020164fc..7a5d1c1a1833 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; }