Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp102134pxj; Thu, 10 Jun 2021 16:07:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt4QHa1dY3gklwApWftn6KVJ4+dc3Ic1V7kTaeH6sqyr9cgVpECUkfzQa6RjzjAnsf2XaY X-Received: by 2002:a05:6402:2378:: with SMTP id a24mr758507eda.161.1623366458355; Thu, 10 Jun 2021 16:07:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623366458; cv=none; d=google.com; s=arc-20160816; b=Ikhs3uSRLGp52YHk1BHO0pj9VsSzQQFbI0XA9U8/GhsxpVDw/tMa5Yf8pVI68rPZZn dtq/vUy6eiSSSaBxXr0jG1bH2ry2E/nvTX5RHsoLvoUN/hZxaw23gJ8folt8N/lL+0Eo bWyOJ8EtvNuVTjU3OJanQz0RBGYgBqdp09PDHqWGruss/i7cuEaSU6KZy4xcH8XvfxVu K3afUncaxYrLb1/sNV+PygR77D8aC66Qbw1xRdsZ0sukEaJxHtLT5bJzkjc852qTKcZV 4kRUG/NlzIGbi2dXvvAehi3jFcw6N2ybLHNtKXyGuI2EiPod9gGAQBClwiJDFugZxA/3 qnMg== 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=qeFcj3RvFIgn+Y/tzqbFYekNNwhIfYGgU+jLdlJf6yw=; b=OQo2181XZwYYxnR5l9P8+TrRDotr1H0MSACVWOoCjnCbG123jwMPkpcA1gdgBJ6iN0 7XlD0aVA2uRHjZG4LXszZpAvaUMTFLRC3Yu5TsVFxJsBm4Zpceph17Giva2ZMkr1h1qx IMNn3uhVTVV63yDT/5lePXB6LJlxngG076qCIk0DK4GxIqmjGjzP02nK2QNSrb0tbK9X vsST5rAe2/5cCFoEJCSOiYtHQ04wJOzdopVeklYKeF+X/crIbn9g15RaD2ZPxpgv/Tht vHfjUEy7vA50zhLTsxAD9y85CSwT0HtfpP9Nq+9nZ8cJR1oZoldX/FwrCJu4ASpMIzX1 ZIxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=S2vuX7oN; 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 cx16si3044892edb.291.2021.06.10.16.07.14; Thu, 10 Jun 2021 16:07:38 -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=S2vuX7oN; 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 S230425AbhFJXF7 (ORCPT + 99 others); Thu, 10 Jun 2021 19:05:59 -0400 Received: from mail-qk1-f181.google.com ([209.85.222.181]:34586 "EHLO mail-qk1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbhFJXF6 (ORCPT ); Thu, 10 Jun 2021 19:05:58 -0400 Received: by mail-qk1-f181.google.com with SMTP id k11so27523593qkk.1 for ; Thu, 10 Jun 2021 16:03:50 -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=qeFcj3RvFIgn+Y/tzqbFYekNNwhIfYGgU+jLdlJf6yw=; b=S2vuX7oNdf+mrc2CccHRI8RD2z52UkXdVZCD3Z4nXs1ZCTOGjOCB00hpBp6Le71dDN nEP3uCRUpx8e82Ph5jWK0V6ONwe0HUyXaLOO5KCWsFXIr6Rp7IYB2R97cJkmT9B/1MsW m228PdcwPPzD4PXXyTkyr2A4nEIYBIrRgSCygv96STR3dn22sZ1WU9gETjb6lL2w0kdb E3PlCgGTZ2IrMT/bj/mrNQ8OH9kJzOyUXA3RkleGCwx8jCSNFs1eWLDj5zCwDqVI7NmT a4kts9fj++lUiud4KgPiMAUmkfbjMsDciun/TWKze+DzJy/xXx9gVqa26XtmmfQo87rO UA7Q== 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=qeFcj3RvFIgn+Y/tzqbFYekNNwhIfYGgU+jLdlJf6yw=; b=sv3bitD9Z0QS/EFKEhxdhH2/5u+3Fb58bUvmgoE1kaTMEUbKXQgPE6J+h0UTg05uWF 9Na0zKdUcKuoUkUStYMANiSnLvqpz+fQ99r8g/9JGikCs0VC5xMRbluJqvVXzHxLvUsl 9K3soXKrVlaD2g6ej5v7MeaNAWjESmZW3nMjW3E4iP8E+/POOI+6DG/yqw/U6u4yaSrE 7pojnbDuR5lXzj5vFlt9Fb92e341saQ4YWL6Q8PfE385k7H3F/h1ST08Rhg8lNEn5A2j x5XBc+suhtqd4+cJ1HgQyW6629zIaitog5VfU/PMtmr1tbEFmbxBvB92FJBeZJw4fk/L Cfqg== X-Gm-Message-State: AOAM532eD2cv2WeGf1EHzMhBEgDZOX+FrPBvrxNfWf4NGz4fhkC5oxIm hzMex2Vqm/LbLpVs8jkfzxa24Q== X-Received: by 2002:a37:9381:: with SMTP id v123mr1087360qkd.64.1623366169388; Thu, 10 Jun 2021 16:02:49 -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 o22sm3063286qtq.89.2021.06.10.16.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 16:02:49 -0700 (PDT) Date: Thu, 10 Jun 2021 16:02:47 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: "Kirill A. Shutemov" cc: Hugh Dickins , Andrew Morton , "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: Re: [PATCH 06/11] mm: page_vma_mapped_walk(): crossing page table boundary In-Reply-To: <20210610093203.x42jpifagiavmrlp@box.shutemov.name> Message-ID: <4679ec74-80a-ed13-e58e-654911fbab28@google.com> References: <589b358c-febc-c88e-d4c2-7834b37fa7bf@google.com> <799b3f9c-2a9e-dfef-5d89-26e9f76fd97@google.com> <20210610093203.x42jpifagiavmrlp@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Jun 2021, Kirill A. Shutemov wrote: > On Wed, Jun 09, 2021 at 11:44:10PM -0700, Hugh Dickins wrote: > > page_vma_mapped_walk() cleanup: adjust the test for crossing page table > > boundary - I believe pvmw->address is always page-aligned, but nothing > > else here assumed that; > > Maybe we should just get it aligned instead? (PMD_SIZE - PAGE_SIZE) is not > most obvious mask calculation. Would you prefer it with another line of comment after the /* Did we cross page table boundary? */ Maybe, /* Is address always page-aligned? No need to assume that. */ I just don't see the point in forcing alignment when the test is good (and don't know for sure whether address is always aligned there or not). I prefer to leave it as is, just letting the commit message document it. > > > and remember to reset pvmw->pte to NULL after > > unmapping the page table, though I never saw any bug from that. > > Okay, it's fair enough. Thanks, Hugh