From patchwork Wed Jul 6 23:59:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zach O'Keefe X-Patchwork-Id: 12908925 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 34D2AC43334 for ; Thu, 7 Jul 2022 00:06:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 925426B0073; Wed, 6 Jul 2022 20:06:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8ACC36B0074; Wed, 6 Jul 2022 20:06:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7263D6B0075; Wed, 6 Jul 2022 20:06:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 628326B0073 for ; Wed, 6 Jul 2022 20:06:07 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 39F68609DD for ; Thu, 7 Jul 2022 00:06:07 +0000 (UTC) X-FDA: 79658361174.06.A85241F Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf30.hostedemail.com (Postfix) with ESMTP id DEB4A8005A for ; Thu, 7 Jul 2022 00:06:06 +0000 (UTC) Received: by mail-pf1-f202.google.com with SMTP id k21-20020aa78215000000b005283ff3d0c3so4272627pfi.1 for ; Wed, 06 Jul 2022 17:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=jUyi07UYBFL66R9xdQey/qmaEetUv9xl7ILS1rXt9pQ=; b=KqxvE6AQgzVCxqIAjNKynfkKICku5M6RMUufXpO/ZO/VM/OeC88xda8DXyH+W3qveI ZSljt08z6fAnMtc+ggmK5sBV4V0NqP/sPgtUequM9Tw1wTXK+XlMUEkw9c4JY+KKtgh2 sl+VyFAw8hXJclLdCApizI3bAtQ6sHamMfAXTcsgBhSOvaV+wrEDiOdOfd91f24DQtdm mt223ucS6YYBeepfoel4zQACGMxFoZptSJuvHIQnpcc6iF/OJjzJTiz6ZEqV23NsA6cj GLSAvwzDy1YWe+AQAN/JqAqlECrYBe+eZb/XLNKee0J9vUz2kBFS64HCsQHhO/Bxq46j dxDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=jUyi07UYBFL66R9xdQey/qmaEetUv9xl7ILS1rXt9pQ=; b=ff0q9+FMvBmNvvzI0NwJ6DYMRyVUDULaYyk2xfDdCE5dKsXoPCrqVYxY8KgZlOzG3V vgQQepPQVdFD4uihwTZhJcby5u8gkXLcWOj2fSDuNrvfdqoEqXaIzocFs69PBl5jopW2 To6R92xyQSPJJPyRQNaBiUJfHeiTv3UB71+ZZWni5QeVwFHHNEaCXwhUO8grnrI2pPXE PQnEF88WE5X0pqnJFfAhJQL8dtyv+9AIerBQSMhneM/Os8IACkKSKgWycaVUZ0mKRc3U XCrOjQUirmcC5CwsYp5YTAC4taLxL59r/Az/RT0nA0qow6nvkgo2B2WoArRTA4H5X8ub q2tQ== X-Gm-Message-State: AJIora+By4OSNmgqdjmpDhAkq+mFSf6v1+MGzdSvji92dgFOsEOQfAmH n/zGb6VTxM9atMPQ7ahLtXUdY/FeLouY X-Google-Smtp-Source: AGRyM1sSXEOVyLnOMlSD0BbzVJAwq9RwGMS9iTW9EfuQjs+Fpwijwm3kgXRWcm6jf8eyWwR5pcyj14Qg2Pfa X-Received: from zokeefe3.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1b6]) (user=zokeefe job=sendgmr) by 2002:a05:6a00:14c7:b0:525:89c1:35fb with SMTP id w7-20020a056a0014c700b0052589c135fbmr49511605pfu.36.1657152365762; Wed, 06 Jul 2022 17:06:05 -0700 (PDT) Date: Wed, 6 Jul 2022 16:59:19 -0700 In-Reply-To: <20220706235936.2197195-1-zokeefe@google.com> Message-Id: <20220706235936.2197195-2-zokeefe@google.com> Mime-Version: 1.0 References: <20220706235936.2197195-1-zokeefe@google.com> X-Mailer: git-send-email 2.37.0.rc0.161.g10f37bed90-goog Subject: [mm-unstable v7 01/18] mm/khugepaged: remove redundant transhuge_vma_suitable() check From: "Zach O'Keefe" To: Alex Shi , David Hildenbrand , David Rientjes , Matthew Wilcox , Michal Hocko , Pasha Tatashin , Peter Xu , Rongwei Wang , SeongJae Park , Song Liu , Vlastimil Babka , Yang Shi , Zi Yan , linux-mm@kvack.org Cc: Andrea Arcangeli , Andrew Morton , Arnd Bergmann , Axel Rasmussen , Chris Kennelly , Chris Zankel , Helge Deller , Hugh Dickins , Ivan Kokshaysky , "James E.J. Bottomley" , Jens Axboe , "Kirill A. Shutemov" , Matt Turner , Max Filippov , Miaohe Lin , Minchan Kim , Patrick Xia , Pavel Begunkov , Thomas Bogendoerfer , "Zach O'Keefe" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657152366; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jUyi07UYBFL66R9xdQey/qmaEetUv9xl7ILS1rXt9pQ=; b=q+Dfkcv73BfD6inm60HE4L5HNhfCKytiUsejP7XlLTvlSdOpy5b3kzgFFWWjZ/IFY+xQ9N NFovnCTL9rhQObLjq433ui/cj5R8X7JLApIeGKXBTA3xqCHHBBpAu8Ib3zHtp2U3zupmqn cmrRopqdPxJRKy7b0fntJybDuLHHRSU= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KqxvE6AQ; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of 3bSPGYgcKCOgjYUOOPOQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--zokeefe.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=3bSPGYgcKCOgjYUOOPOQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--zokeefe.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657152366; a=rsa-sha256; cv=none; b=E1ja+tYeYLs847uHRft0foNmJs3lK4CGQgygdsAEzbNoxuB8bTRKiWBdC7QLyWNxxUUjg9 P4GIGBwDm3srtonvCGoPftibxq63v61O/ykEzVObS11kUHsOh1An+JTK5W1bz2BD4TUEr4 VMMqLBPP63T9ZCn/7lDog93bmkSRcKk= X-Rspamd-Server: rspam11 X-Rspam-User: X-Stat-Signature: keb5mgw41ji57ee3gg853shr76zo7u3i X-Rspamd-Queue-Id: DEB4A8005A Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=KqxvE6AQ; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf30.hostedemail.com: domain of 3bSPGYgcKCOgjYUOOPOQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--zokeefe.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=3bSPGYgcKCOgjYUOOPOQYYQVO.MYWVSXeh-WWUfKMU.YbQ@flex--zokeefe.bounces.google.com X-HE-Tag: 1657152366-795940 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: transhuge_vma_suitable() is called twice in hugepage_vma_revalidate() path. Remove the first check, and rely on the second check inside hugepage_vma_check(). Signed-off-by: Zach O'Keefe --- mm/khugepaged.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index cfe231c5958f..5269d15e20f6 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -918,8 +918,6 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, if (!vma) return SCAN_VMA_NULL; - if (!transhuge_vma_suitable(vma, address)) - return SCAN_ADDRESS_RANGE; if (!hugepage_vma_check(vma, vma->vm_flags, false, false)) return SCAN_VMA_CHECK; /*