From patchwork Thu Jun 10 06:48:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12311967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44E5AC47094 for ; Thu, 10 Jun 2021 06:48:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D734C613CA for ; Thu, 10 Jun 2021 06:48:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D734C613CA Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 639096B0036; Thu, 10 Jun 2021 02:48:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EADE6B006E; Thu, 10 Jun 2021 02:48:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 463B26B0070; Thu, 10 Jun 2021 02:48:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 0EDFE6B0036 for ; Thu, 10 Jun 2021 02:48:31 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 88DAF2484 for ; Thu, 10 Jun 2021 06:48:30 +0000 (UTC) X-FDA: 78236885580.10.B7147AE Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by imf13.hostedemail.com (Postfix) with ESMTP id C3954E000263 for ; Thu, 10 Jun 2021 06:48:25 +0000 (UTC) Received: by mail-qt1-f177.google.com with SMTP id r20so4838850qtp.3 for ; Wed, 09 Jun 2021 23:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=XjbJY3bhcvz+MAqs2y5uU2ExaAj/cTy23+6+m0vOS/c=; b=I2WARsLE20TkLuIVtRJfaR8NkDW8Mh5SgTQetC6Ey2uz8oIN+hK8GOKLV//ylUEunK UYegTMLZhwgLPDXrCDGfFt3fJ7kfM3u3u0mdeqh/W+ap9iybINc16XhxcA0IMt+pSPwm xAV56qp/7PhWmC+inxJFChXmiH6CQWjftP6luik04P2FnKSrMCrer6qIhA+VDMa+ZKJp HOAORdh7B5Aw12YZSxAP0b1XFbjWG0fGB37ywSBa5Ct9uB1C3gy3866G3HG1nxRyGIsh ukbE+hvq6jmARKs34+kHlujPcAsY2C5dTNGMgbsQe0ZrPK0+gqF/sqB6f2uhiS36Aw+v jAwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=XjbJY3bhcvz+MAqs2y5uU2ExaAj/cTy23+6+m0vOS/c=; b=W/QB/Y0m59loaYII48GnurzNBSDc5LdTZwy1FaXL9QT2KjVjc4AUyOQt9c7l6UrrzD 1FM8+Q4BPID0tyvmXxVqRq6TxDGLcrvdQ6lx9dTf/Q5psESxV1UAlMXoQwW+Qt6ckxmD 4iz48cIs0lpxj/AmuSR1n3wzdNxHLwTrnk0da+u9Gw/l1EU/k9p7qE4ZzrwRTs++6eJx 2nHRkbwRvFcGw0tmukQ6JvfbFn1jTC9v1Fua/+lg75OGYKyf7f3gl5SUQBHFEgS7iNxp 1mDj01fwRaVl7bu0js310r7Si7sSnBaxZMCN2kHygJPosus6bRR320rdFwqKEIUUoJLt 6qcQ== X-Gm-Message-State: AOAM532MJYaQ2U6XxM1bqIRm1fyAlqwJU991XDC5w4PY7P7yxAF4RVIm Phnz+4ZvMkjwFG/EbHsyr0sgYQ== X-Google-Smtp-Source: ABdhPJyrJW/zsSc4BAg8bOs1VCqXKeTl38AuBEzX0YuNIvPHH3vnd5WTuOWVltVf8BYzC10bBAVy5g== X-Received: by 2002:ac8:4f42:: with SMTP id i2mr96547qtw.350.1623307709464; Wed, 09 Jun 2021 23:48:29 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id g15sm1723464qkl.53.2021.06.09.23.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 23:48:29 -0700 (PDT) Date: Wed, 9 Jun 2021 23:48:27 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: Hugh Dickins , "Kirill A. Shutemov" , Yang Shi , Wang Yugui , Matthew Wilcox , Alistair Popple , Ralph Campbell , Zi Yan , Peter Xu , Will Deacon , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/11] mm: page_vma_mapped_walk(): use goto instead of while (1) In-Reply-To: <589b358c-febc-c88e-d4c2-7834b37fa7bf@google.com> Message-ID: References: <589b358c-febc-c88e-d4c2-7834b37fa7bf@google.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C3954E000263 X-Stat-Signature: ydck3dofi1t7y7pg1qkrpdpkc3zoje7u Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=I2WARsLE; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf13.hostedemail.com: domain of hughd@google.com designates 209.85.160.177 as permitted sender) smtp.mailfrom=hughd@google.com X-HE-Tag: 1623307705-176984 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: page_vma_mapped_walk() cleanup: add a label this_pte, matching next_pte, and use "goto this_pte", in place of the "while (1)" loop at the end. Signed-off-by: Hugh Dickins Cc: Acked-by: Kirill A. Shutemov --- mm/page_vma_mapped.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index 0840079ef7d2..006f4814abbc 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -144,6 +144,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) { struct mm_struct *mm = pvmw->vma->vm_mm; struct page *page = pvmw->page; + unsigned long end; pgd_t *pgd; p4d_t *p4d; pud_t *pud; @@ -234,10 +235,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) } if (!map_pte(pvmw)) goto next_pte; - } - while (1) { - unsigned long end; - +this_pte: if (check_pte(pvmw)) return true; next_pte: @@ -266,6 +264,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) pvmw->ptl = pte_lockptr(mm, pvmw->pmd); spin_lock(pvmw->ptl); } + goto this_pte; } }