Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2495797rwl; Thu, 30 Mar 2023 11:05:30 -0700 (PDT) X-Google-Smtp-Source: AKy350YMB1tiZXf1+rc9xVTPe8kBEo1nCx91AoAzdjHRGtaqGC/oXysuNjCivjz3O97CXqZS/sSz X-Received: by 2002:a17:906:207:b0:933:23c4:820b with SMTP id 7-20020a170906020700b0093323c4820bmr2728505ejd.4.1680199529932; Thu, 30 Mar 2023 11:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680199529; cv=none; d=google.com; s=arc-20160816; b=AuR0PaRBSAQHFIExfKjjv8KdWNL52cyUKIldoo+b8pe6AgwLDlhBcKaeYK/+SP82sr sYu4MDGFq0N3629D1yrvzHM+8GvH0YA0tmQPR4oL2/JoYBzlnMueuSODUG8/Au5Cvg+l 7Fsu+GuQrItITmOgewrqSct2yC4ur0bA/+U1XJPygVM7I2CRxBdJUD3mS1MgpIG27kTC wpo4Imr9BcsHe8664ckoF5F7+WvjntpkNmKAR17zsE6UIb7hm3HsjIOJ//eqRLku18Pg gqywWr8jpdu/bQZl0FQERSp7oS/7f4nqzTNbDVXYQJYJju8Qqerm3VfTf5mCQierXW2N oxQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1Aa7UYbp3NZ+5Vx0LEPR8MqsdlgGFeZ4MOxoVkSDaxY=; b=WrVVv1NUobd0HGnTwcvwbssJNrgtY8ZWExBaX+jd28tlP+HRr+nB9A+S1fk0SI46Kz xUyHwHzICV3d1qbCXsYi/WelD8AlZucgWYnPxoTFPG0k9UB1cHfbqUpkOcvXyv0to6UW hnQdvatjxi8nOgezTIlskCGnB9FzNsD4u6fCweR+vqpnLGiCk49WS0Pjx9gHfDMz4PbN un4na7z+AltasEr3NH/KeLNrKYpPQyJ9R3C/fxXVJgy0H6h1CnDck1R+RAl2rTqNqv3k uSIRoR+dx5kLmgKORJ+wtrDF75Nill1vm5BxHgycLv3eZ8uHV5MBhhciBzLahfKKlNnH DVGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZmZhfNUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020a170906501200b0093defbd6274si111518ejj.1019.2023.03.30.11.04.38; Thu, 30 Mar 2023 11:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZmZhfNUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231138AbjC3SDC (ORCPT + 99 others); Thu, 30 Mar 2023 14:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjC3SDB (ORCPT ); Thu, 30 Mar 2023 14:03:01 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 166A0CA1D for ; Thu, 30 Mar 2023 11:03:00 -0700 (PDT) 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=1Aa7UYbp3NZ+5Vx0LEPR8MqsdlgGFeZ4MOxoVkSDaxY=; b=ZmZhfNUm4wQbR8zStejmdtqI3P O3Bl/BlqUbMGfIaar03ALiOL4NtAwTF3Dk5QjbsmMgYucNmufEB4bKVVUO7ngPAXfj8itxj1dG4Qz N2NHsoSxEbFObLnwzsx4oXmS8X5uNnrIHNF7n/3IUMB6TtJRcOcJM/MgpU6hu3Bqc5n1ylHUJPMUD n938UPYykb/muMv+CVr52UVX/WjwTpC1juSHVgOYXsIDzXTN9itl7XUyl4tfBpJXuheH2LXrFHyY4 bUNCsu0MiqEep+0V0IVf/3qOSCcmcF/dQxAFLAJhjm9RG7BPUNskE8KBuMlAg6S9o2XbcXc0/pHVI t3OrDFyw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1phwbf-00AdP9-JM; Thu, 30 Mar 2023 18:02:39 +0000 Date: Thu, 30 Mar 2023 19:02:39 +0100 From: Matthew Wilcox To: Sidhartha Kumar Cc: Peng Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, mike.kravetz@oracle.com, vishal.moola@gmail.com, muchun.song@linux.dev, wangkefeng.wang@huawei.com, sunnanyong@huawei.com Subject: Re: [PATCH v4 1/6] userfaultfd: convert mfill_atomic_pte_copy() to use a folio Message-ID: References: <20230330134045.375163-1-zhangpeng362@huawei.com> <20230330134045.375163-2-zhangpeng362@huawei.com> <765d450c-2ff6-1420-b94f-528d56bffee4@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <765d450c-2ff6-1420-b94f-528d56bffee4@oracle.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 10:02:52AM -0700, Sidhartha Kumar wrote: > On 3/30/23 6:40 AM, Peng Zhang wrote: > > From: ZhangPeng > > > > Call vma_alloc_folio() directly instead of alloc_page_vma(). Add an > > assertion that this is a single-page folio and removes several calls to > > compound_head(). There's no added assertion in this patch any more, so I'd drop that part of the description. > > if (!*pagep) { > > ret = -ENOMEM; > > - page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, dst_vma, dst_addr); > > - if (!page) > > + folio = vma_alloc_folio(GFP_HIGHUSER_MOVABLE, 0, dst_vma, dst_addr, false); > > + if (!folio) > > goto out; > > - page_kaddr = kmap_local_page(page); > > + page_kaddr = kmap_local_folio(folio, 0); > > Should this variable name be kept as page_kaddr or should it be changed to > something like folio_kaddr? kmap_local_folio() returns page_address(), so > maybe page_kaddr is better. I'd just call it 'kaddr'. Or 'addr'.