Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp114727pxb; Tue, 31 Aug 2021 16:37:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziQUtCXbDtHBaPl/8H+xTPw4ctA9MzQVcGaiRrBVmSvGlaw8DiqdVmZTat49JJ6z2ovDWw X-Received: by 2002:a17:906:5246:: with SMTP id y6mr34011688ejm.451.1630453059028; Tue, 31 Aug 2021 16:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630453059; cv=none; d=google.com; s=arc-20160816; b=wphqC0KlXplnyT57hQ4fVSa2mtOTnkPdFuEAc3Va1zYO+kzSyYxjWezoO83y9i6LoM hQJxef6zHK2c9eDpAt5fGzEhC9MtMenjUYBDIQ1zntucGWyVvv+qZAARxX6RvKlVQcnL J6vMz7a82iRn6HYSAJ/cCcmu7+bqOc3SU0obKq3qJVclcq8kvfXxKRzxd2V4PZ8TtMSR KmcFn2MPkMd/1eHnW46W13785XHCmTjPvzqdGYCNOluU/Unvvo7J29eqpLhZRxqeNNtg K5pB7nB/9GwhvyCJPS5yQrbjx3Vc/MBwcIHK35eGPrZnMSO8gb47p14o+a7CmmVueFl2 LHYw== 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=qTGMUJ1fnMBo+Q1kt2wvOXORnThBqbNZ7LIT9ecQXE4=; b=EMw/hJZ9m1xC/R7tiZjS1Wgnz58Jj4+S1g7D7kqsZVFAySh2XxZSDV4kju7QJozUYN kWrTUkwHAc9uh7q82NFNNAo3Nt784BQKBmaDVKiU5N6Ma1eX3N4CEnXNNZX09f0p5ObO nE5hHM6Hq9yZUCOdAg4lt0rUrzy9ahL6odwCW8xEELWsH2VX0HKv3MgvlYy2ZZ9L4tg/ atHzJ1z7wGnqBwDyNYd5PjmxxVbkhSjtx+grMeDE7vhM9mwbv1PKGXMbMTB+eMsD7W6x TJg9wgyGKUY81Xp2wH7IEEd5Xz/LchuKIs0QtxIBFNQTnH6YWPgX9mIcFo6L5bMLMtL6 +C3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=mER5XiOy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si515755edd.519.2021.08.31.16.37.15; Tue, 31 Aug 2021 16:37:39 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=mER5XiOy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237525AbhHaXYC (ORCPT + 99 others); Tue, 31 Aug 2021 19:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232815AbhHaXYB (ORCPT ); Tue, 31 Aug 2021 19:24:01 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F003C061575 for ; Tue, 31 Aug 2021 16:23:05 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id y34so2373793lfa.8 for ; Tue, 31 Aug 2021 16:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qTGMUJ1fnMBo+Q1kt2wvOXORnThBqbNZ7LIT9ecQXE4=; b=mER5XiOy8koaS6tZs5Ukk1lV155l26r6AQblG/hlIf0ZFf/+gW0mM16KEMts/pyGmA ilRwF+Z4fobIIzSuTSpXu33eLW6jkFJniOlhjt2hbdwlxgPpimuujwWKFM2TS+HEUVN9 LhNOezSMIVpxmqtKpJPIN904HC5vZoWULfSRKYezTueepxfIzQhdkCISGTJ1RQN+UC15 pTtKleTC00QRxfN+DoT5bvHjGkFoaujebReNJhvEk4cSVSMMZ+anYLaUeYFwYqSfASXh gCVnsEMoFaU0R5rHnxOsfbyk36zn7uexsEeE6kiidqNVD3f9w+tJXYVLRdTrKFzKCqmQ aoQQ== 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=qTGMUJ1fnMBo+Q1kt2wvOXORnThBqbNZ7LIT9ecQXE4=; b=HNdHBmIPvsuIR5mkl5qZSQPQnsoEoua8jdm7XN455fwdMtCrs5kANQ7zkgWrViOFP4 5IBP7rgTfJhhaczi9qGgkhVFe2hA8XvT0kPaNp4CNyXaDBcx03nM8iM56bEBqhais1Vd 3Bq5wpD6loEJBQFvNTBsg+rgiuvRgn5pLT6tDMiCE2GJywxge/fYXeaBZ3CCDmIn7C9l wrCOsI25P+4tm5+OMX/1GU4LkKYBMYGvx2oygs8Fd/pWabUKKpP8N7ea7ThYgRNgktrU fYewIJiTxPq5kPGQddMguB58rmjyztHEfKqeO462UwSTBLxc0Jr3Ai4jX8eJqoTyY0gU 55ig== X-Gm-Message-State: AOAM533b5rqYcZIAxA2BCtLRINV1RFTB6hMD444V8GXWrBjGjcjjWpK2 xSX5yIS1adOeB3SmTCJrQzeisA== X-Received: by 2002:a05:6512:e99:: with SMTP id bi25mr22941004lfb.486.1630452182771; Tue, 31 Aug 2021 16:23:02 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id k3sm2263434lja.109.2021.08.31.16.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 16:23:01 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id B7BC9102EFE; Wed, 1 Sep 2021 02:23:01 +0300 (+03) Date: Wed, 1 Sep 2021 02:23:01 +0300 From: "Kirill A. Shutemov" To: Qi Zheng Cc: akpm@linux-foundation.org, tglx@linutronix.de, hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com, kirill.shutemov@linux.intel.com, mika.penttila@nextfour.com, david@redhat.com, vbabka@suse.cz, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, songmuchun@bytedance.com Subject: Re: [PATCH v2 1/2] mm: introduce pmd_install() helper Message-ID: <20210831232301.ilehcpc3n5bqodsz@box.shutemov.name> References: <20210831132111.85437-1-zhengqi.arch@bytedance.com> <20210831132111.85437-2-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210831132111.85437-2-zhengqi.arch@bytedance.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 31, 2021 at 09:21:10PM +0800, Qi Zheng wrote: > Currently we have three times the same few lines repeated in the > code. Deduplicate them by newly introduced pmd_install() helper. > > Signed-off-by: Qi Zheng > Reviewed-by: David Hildenbrand > Reviewed-by: Muchun Song > --- > include/linux/mm.h | 1 + > mm/filemap.c | 11 ++--------- > mm/memory.c | 34 ++++++++++++++++------------------ > 3 files changed, 19 insertions(+), 27 deletions(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index a3cc83d64564..0af420a7e382 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -2463,6 +2463,7 @@ static inline spinlock_t *pud_lock(struct mm_struct *mm, pud_t *pud) > return ptl; > } > > +extern void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte); > extern void __init pagecache_init(void); > extern void __init free_area_init_memoryless_node(int nid); > extern void free_initmem(void); mm/internal.h would be a better fit for the declaration. Otherwise: Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov