From mboxrd@z Thu Jan 1 00:00:00 1970 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 E0A76C4345F for ; Thu, 11 Apr 2024 17:37:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 785686B0096; Thu, 11 Apr 2024 13:37:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 70DA16B0098; Thu, 11 Apr 2024 13:37:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AE126B0099; Thu, 11 Apr 2024 13:37:44 -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 3907D6B0096 for ; Thu, 11 Apr 2024 13:37:44 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F09DC160C8B for ; Thu, 11 Apr 2024 17:37:43 +0000 (UTC) X-FDA: 81997958406.10.6882843 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id AB7E580017 for ; Thu, 11 Apr 2024 17:37:41 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QBmYFmD+; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712857062; 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=oo5kbA7wq9PHL6OBsZNxtI6JG7umKvViYFq9+V26hQs=; b=bTagL4789a84nkdNQ7sSEVKTQcqjKRD9l4CPObgpEocbThKY4u2VMqh0VHSFn9fpBGM5ZQ W0zoCnV2vZU1Y7w4fj1/Yalvfg6Ris9oy+mAyunSr2E0nw+yUf5TjiSPT2LW3BhRJptBnm REL3GGtiOU1VeF+mQzer8ECUTuRTb7M= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=QBmYFmD+; dmarc=none; spf=none (imf02.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712857062; a=rsa-sha256; cv=none; b=PEXskKbDnNxIkN8iG9jBmcyzvzzjcARWDieGVPyhfiJg98ipGn12xfzoKA2oLoCL8QiIWY UUwbRzMyCaWJiVTBbijgqYVBOOMMM8Jcm5uP1CPN+nMHjUwYHOlOgNXFHvlmbLJ310KKkL BX1CdAnRZIcdNIBWWCLzlHxbTGUD9dE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=oo5kbA7wq9PHL6OBsZNxtI6JG7umKvViYFq9+V26hQs=; b=QBmYFmD+U0r8ZOZYou0jH7i19P 0z0OefZULdroBh5kroRMojbjVBz0vK9E4yRjxHvbSIp+H3wYJqlFhi3DqW7inrO+iE1Oigs5zQLf4 SrvVl57rhkZWM76ywfNEb4hUCmCJyvtgX+NfEM+yEiUjjg4xQRvp2jW7h3WOuvepk9/jKmP5RSeHE n8LCPWf4NHjGDtt4iri8RmS5nCtIguA0mwXR264ipEFF3eUg+sQgoI3JfiteUK0CQjqe6sSMFlaCF SBXpG3pdu8whNUANK3gB/9CZGBQDl674ASbtE2wl1nHaECDZL96ZTWUDZOHtpiFHaFJnHL2YB1aDd fRU1ojbQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruyMf-00000007QTS-2CD3; Thu, 11 Apr 2024 17:37:33 +0000 Date: Thu, 11 Apr 2024 18:37:33 +0100 From: Matthew Wilcox To: Oscar Salvador Cc: Miaohe Lin , linux-mm@kvack.org Subject: Re: [PATCH v2 03/11] mm: Return the address from page_mapped_in_vma() Message-ID: References: <20240408194232.118537-1-willy@infradead.org> <20240408194232.118537-4-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: AB7E580017 X-Stat-Signature: kapxojbd783oka8jzp5eijrud6p88d1w X-HE-Tag: 1712857061-145375 X-HE-Meta: U2FsdGVkX1/mja52YKXmkeo8Kmzjh823V9ihpMzS0LpmvqnT+mp3M8GbKF81nE+qNDullZb5Z3H6Dm1DwYglMYia1933ROIMeCt53mp81/jneH1pzM4qo1yqtQ4LNli3BaJCShnUJTEmqhVIOp+xpMISteAj1RZlh65rNauuh5a7jXZ8nCmdE+/zmv+Hy9CWDueMluG+gHazoZvIkHy4uoulpEtB+eB/Ym7KXFqGA9zbM9jOYDNLJthqtp05CPyB3cJIdGLCB+v7RxcfU15b1DCJGv/qI5mOjekjKCjkuGiPKzLoj4uqHtGNt75Cvd2MFMtY4HGhygj0lchdGgxzWKK7UFwIRbEiClUzNlmVLfTg3a+XdjDJy1ql426mAtQNKqJn5SVQxuhWWWMJBDIk0BHQrSdHxdkNjOx36UnOj8A3X3hVRKoQkArKHMVJdaOyGcF4rqKVKaWr/PfgoDAi/TDsAxKDS6YrJLcsJPhC+snIz0i2rlWatP5YQS+fBiJjd1yGYGcvuFgBV0N8f/gl/y8o1iOx+NF442Yl944eDoLcWvwc1H0lwNnB3kSmylfEOP9zI7AXj5fDt/SIeiJ/h3kYE9aS3vMQbDt02RfX+K0biX7wXbnqgm1q5Ir2MOPfjqcnZ5t3MYBaDpqiaUJdkaGc86shTSBrqlZHHGCrPDq2VLc5w921CBG2ug4YBE0BH4AWTbpLNT/DtltkAPMYwnclYh6/34rD3EuqhKSdJ+5RjNFX5B7eN1ErnlFKN0uVil8/lo/2GRKcnju0VfWcGywepl/S0kcsrr90/L7/pzp47M0E1E0XdIL2It89S/wx9GqOofMQt67timbqM2sEs9IkBP8THkHLOj3yrpZeN5fc65shvDGw5GMZqxXdEyjY3OPop1aG27PBtLaDbJtmGEKN8KK++VsL/7nCA09hlxyH9QPJvYef9znJBtKWDi16XBboe7kuANHNl6IYGJG HwCXpHlN eCfZKUl53G3mUYsXblMDrXF3akswslFTbBwHqDg6sMpA+dj1QMeVvZt45r4KqAdz5joqT4hIWj0bBmZLagUXfKe4wysGZJUXztPgp80ZdkvjeMpPyArnaNs0nW/xlazrWhcrTfe14VYcshdce72ZVZRrWMDnjF10vOuab0DyLLiqyTh4naJBOsoi4U7qOO4D0Ujl50hXxmJAtSjoGWj8kZJaOI8ze7XrVCoLOr/KU4qIVySMng16mRn54sYseWEj0DMWCiJwHHMnJ7T8= 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: List-Subscribe: List-Unsubscribe: On Wed, Apr 10, 2024 at 11:38:36AM +0200, Oscar Salvador wrote: > On Mon, Apr 08, 2024 at 08:42:21PM +0100, Matthew Wilcox (Oracle) wrote: > > The only user of this function calls page_address_in_vma() immediately > > after page_mapped_in_vma() calculates it and uses it to return true/false. > > Return the address instead, allowing memory-failure to skip the call > > to page_address_in_vma(). > > > > Acked-by: Miaohe Lin > > Signed-off-by: Matthew Wilcox (Oracle) > > --- > > mm/page_vma_mapped.c | 14 ++++++++------ > > 1 file changed, 8 insertions(+), 6 deletions(-) > > > > diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c > > index 53b8868ede61..48bfc17934cd 100644 > > --- a/mm/page_vma_mapped.c > > +++ b/mm/page_vma_mapped.c > > @@ -319,9 +319,10 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) > > * @page: the page to test > > * @vma: the VMA to test > > * > > - * Returns 1 if the page is mapped into the page tables of the VMA, 0 > > - * if the page is not mapped into the page tables of this VMA. Only > > - * valid for normal file or anonymous VMAs. > > + * Return: The address the page is mapped at if the page is in the range > > + * covered by the VMA and present in the page table. If the page is > > + * outside the VMA or not present, returns -EFAULT. > > + * Only valid for normal file or anonymous VMAs. > > I am probably missing something here but I am confused. > Now we either return -EFAULT or the address. I don't know where the other hunks from this patch went. Going back through git reflog, they're missing since the very first version applied to the tree they're currently part of (using git-am, well actually b4, I think). I'll resurrect them from the original posting and resend the whole patchset.