Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp273332pxj; Wed, 9 Jun 2021 23:50:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztmWHXgiRDyUdFPeHvbFCQBtEWy7z8WVfxWC1g0RHnXSwMWE5W22mO9ghWXpq/rHfQiIR4 X-Received: by 2002:a17:906:f2d6:: with SMTP id gz22mr3046455ejb.137.1623307815499; Wed, 09 Jun 2021 23:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623307815; cv=none; d=google.com; s=arc-20160816; b=HDMu1N3xbvHGmzskAg3+NNBNt6TOHr52jo/cey3zy27ehA2l/Zavh/1wHuhm7jq6WH D442CRaODdNxQwsUGH44ZdkNdHODYQfKnJsx8JB5bkz7kQ/td50ZnNOr+XmTZ6XRj3B4 y77fW2845h+HQHNkG4fsiYdc9UVTli7k9b5ZMjK8+upwqZR+Sd2IP3kCWluYKx9rkXtT MEt9Una9Sh4jsYWNPoqkHefPoiXvGvGEGTKYj0S9OEyAUoNY01qvlwgBELK2DjwacKv1 oEt5/Vr0XCy46c7wBRGazUsqHISXqiOolYlX0dNRrNcHh1W9KdatJ9k3M9dwOkdMc5Uv 6dNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=XjbJY3bhcvz+MAqs2y5uU2ExaAj/cTy23+6+m0vOS/c=; b=w/iBH+lvIiMQhhKQAiHM0lJduvfbTq2gHd03pNEOtpjQ/rDnYx60b6ZWvfSe90zOye 06akt6XKWGyhVAe2X8ub/gj8nqTxv8CL70/umpaVC1gIdhdvkht7CakTR5I5kUUqthsp AS+qQoEe2T4+Opz2kaUe/ngKyHRYzvXh5Rep1cqpxUltmVOPSuLILyqxO3fUfZpTAQue advQz0hyxrsxQW+9tj0BWDDz46em/nO8JOYiSkBSwVQ9061Fd1kM78A4NMpU/Ify1xTj wuCO6EdG5jXkj+Z3bU37mDJwLOE2BNtAJ2vnp45a58w+YQuOJdFu5lY4Yz+aomx/5iEM i6vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I2WARsLE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z26si1639085ejl.744.2021.06.09.23.49.52; Wed, 09 Jun 2021 23:50:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=I2WARsLE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbhFJGua (ORCPT + 99 others); Thu, 10 Jun 2021 02:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbhFJGu3 (ORCPT ); Thu, 10 Jun 2021 02:50:29 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACEA4C061574 for ; Wed, 9 Jun 2021 23:48:33 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id v6so11236728qta.9 for ; Wed, 09 Jun 2021 23:48:33 -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=tC6TnebT6sndSjwzgdYdNvKLgm28irlAam3LuAYcuszoORMAO/pgaRskmQucoTc7rE 1dmOGUCCs94HU9FQkIYp8fY6BSwDRbIc3BRuq4hO7MQMdrZjAr3ZzWknCnZD55y4we9S WcfNbO7VNQISyGJcWQ8kJIySHpnz3R32q3zgdcpfZ3GbPAl/xUK262iIM9a700/ftspA 0/gm1bEzKZV5o3zAre9Gk3IFtA+4GkwqRkQ6AzU4buGOa2SE/qkczDcswGC0R1k5Scm8 5HE8H+iZwU6lSMzwg6XgvgN5s9sRhadSjWwDToXFAN2BnjHRpBrE1F3hIb47AiaDLC0p /Zmg== X-Gm-Message-State: AOAM5319rNajzB0k4q1BeKH6nWqNeDcjK7JuoycLzXFl+M8csCNOLweb do5tnSbxNNS5aSRC0c5N7HcJOg== 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 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: --- 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; } } -- 2.26.2