From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC84D1DE4CB for ; Mon, 6 Jan 2025 13:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736169807; cv=none; b=dnzzlETZWbSC6wu+baLJMEaTfuRLFo0TODj/6gK2al6Q22PySR95TLBGQhvRoYyE8mlqwFPmFp+JQ2QB/kzNmWIRcb1c++gjiwUdPQfyGZCtUnXjGNvk4YwYI2opDK1+rVy0SkJyGLqgrLVgTAarHFi+GX33wnGxye3a+BJc/Qs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736169807; c=relaxed/simple; bh=AslleoXTRiRbWr13FtvX0Ckl/9sdreGxSQ4NH4wFg4A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b8Vr4Ycb28SnfdqfjvyTF1s8DeAPKhNVxApwNnEk39Dvqf+RtXQpN8VGm1n7KT4VVO+YQ7DyANxmxPW45jy/sUzADPNkU9bNmvwE7qtwXKKHMICfllJB6/3vTBP0kQLBJIQQS6vXTC7NpaI6hc9SPMCY/fzoo4i0HCjX0jFwuZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=iI74JgsW; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="iI74JgsW" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21669fd5c7cso208853115ad.3 for ; Mon, 06 Jan 2025 05:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1736169803; x=1736774603; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=af8Jbj+kqP+p1W8uyVyt9V0YBDVs6Wu8XxDGXWv1rDo=; b=iI74JgsWTKG37DnW1YB/IMki+ScFHLvhEOk3vxDv9FgI6CI9jtlHtVi79I2xbSTyM0 VdBztaV4PlDix6fx6Q3JW9PtPijrK1Ant99fgmA3is03DXu6hHX041PZwIdTpkeOjtKN LoDu7u38zHH64G1Ap/bFiO2Ul4iVjxZgRJ22LavyqnEuA4hlfThhKkPpKvqpm+Yl4HWd 0Y10N6CsIor4KJg9gJ0tR5ljeF+yarKareNh75UOnmdOXB3oHayFxKL/nV0iYlWUDX2N n0o/oAxFwFOpZhIRnap5aLfCm/HwMLi3b9miICri0ljBKer+MO7weBR7HlkCSFvoh1c+ NJrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736169803; x=1736774603; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=af8Jbj+kqP+p1W8uyVyt9V0YBDVs6Wu8XxDGXWv1rDo=; b=kFXWcVhizWVSOjituZ6RVdJiF6LBLBfXIbSeOnKGYO110lKtrjO1VVxoqK7BEN0MX1 35ERLd4kw6s+MoIwrlSY6bGbgj2xkw3obxEuPK+3YrdYaVsNv73Bgi2QMwH0A6klo1Ip 4cc5n/MJ0IYqMc1kquN4UG19NmTFIKKHPzEusMqhdjK1FFsw3IP8R13kAxUL2GTDyqqx D85TV5/i1jlI2paTTAg6KxJGho80++0ol5RBRMcCbANLU3NP0bAd/+My/x6HAotBil3X u8EXjurcSGRW9TEjtU1FwKPyp6ty0mNJzO7ndXom4WXlV5gOA7Vx1lxPTVXdwcc4J2Qg RNuA== X-Forwarded-Encrypted: i=1; AJvYcCWceSvsL2EErrRNVijwEzgI1L0AO2I8lKjg14EycAwLQV/569muhF6fMDJD/ym3PE80tshos3LpGpde@vger.kernel.org X-Gm-Message-State: AOJu0Yxw0mruyVDdR5PBlWPnZkUpEcZlr+wimUJ1nl36vE61srdM+WBs Q6GjOH88K9SY/SOowVJiOPwIPqM30j9accmXOeVam+pu1ZtjUw8m3Z936fi/zOo= X-Gm-Gg: ASbGncvkR6vMHypWnHtXs2D0/RjqVqVo32/RPwoAVuWfWh0juFi+6tdSTH1OBVyhgFp 3xesMff5InPRp6PyFMTzBiuOvrSLnjlaPVqyo5wO/mMoi1XVEdvrOU8CPSzXx/cxArOVLA5ELXx B0sMnNtdkXJi953kvY+Hw0uqtCOQZBTKSXkIugSq1voEHXm3wfCFBQlo2QHeksTWV72nz54+W9E DjJAFi6DttqLUxJCKhrWv9y48m2TN6XfJfecNvAz3EXWMbDwrOAmXwek8s38PN9wNFZre/m645E S0BWbsg3ijIuR5/nRBOgEwPSXMD2fcuI5rUgZ8YQFbCM54+vgHEy X-Google-Smtp-Source: AGHT+IE/ZrXmD5LZyqp5+IF7XucHWltqSucrfnZMLD6UEt/qaBj6OXgwMq9je0lWMbXPRWlni+TKWA== X-Received: by 2002:a05:6a20:2d07:b0:1e1:b44f:cff1 with SMTP id adf61e73a8af0-1e5e07f9c06mr81291446637.33.1736169803320; Mon, 06 Jan 2025 05:23:23 -0800 (PST) Received: from ?IPV6:2409:8a28:f44:d64:296c:a8f3:f81e:f88b? ([2409:8a28:f44:d64:296c:a8f3:f81e:f88b]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad90c149sm31371677b3a.191.2025.01.06.05.23.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jan 2025 05:23:22 -0800 (PST) Message-ID: Date: Mon, 6 Jan 2025 21:23:10 +0800 Precedence: bulk X-Mailing-List: linux-csky@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor() Content-Language: en-US To: Alexander Gordeev Cc: peterz@infradead.org, kevin.brodsky@arm.com, palmer@dabbelt.com, tglx@linutronix.de, david@redhat.com, jannh@google.com, hughd@google.com, yuzhao@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, lorenzo.stoakes@oracle.com, akpm@linux-foundation.org, rientjes@google.com, vishal.moola@gmail.com, arnd@arndb.de, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, dave.hansen@linux.intel.com, rppt@kernel.org, ryan.roberts@arm.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org References: <8ada95453180c71b7fca92b9a9f11fa0f92d45a6.1735549103.git.zhengqi.arch@bytedance.com> From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/1/6 20:36, Alexander Gordeev wrote: > On Mon, Jan 06, 2025 at 06:55:58PM +0800, Qi Zheng wrote: >>>> +static inline void pagetable_dtor(struct ptdesc *ptdesc) >>>> +{ >>>> + struct folio *folio = ptdesc_folio(ptdesc); >>>> + >>>> + ptlock_free(ptdesc); >>>> + __folio_clear_pgtable(folio); >>>> + lruvec_stat_sub_folio(folio, NR_PAGETABLE); >>>> +} >>>> + >>> >>> If I am not mistaken, it is just pagetable_pte_dtor() rename. >>> What is the point in moving the code around? >> >> No, this is to unify pagetable_p*_dtor() into pagetable_dtor(), so >> that we can move pagetable_dtor() to __tlb_remove_table(), and then >> ptlock and PTE page can be freed together through RCU, which is >> also the main purpose of this patch series. > > I am only talking about this patch. pagetable_dtor() code above is > the same pagetable_pte_dtor() below - it is only the function name > that changed. So why to move the function body? Anyway, that is Ah, I just don't want to put pagetable_dtor() in between pagetable_pte_ctor() and ___pte_offset_map(), so I moved it above pagetable_pte_ctor(). No other special reason. ;) Thanks! > just a nit. > >> Thanks! > >>>> -static inline void pagetable_pte_dtor(struct ptdesc *ptdesc) >>>> -{ >>>> - struct folio *folio = ptdesc_folio(ptdesc); >>>> - >>>> - ptlock_free(ptdesc); >>>> - __folio_clear_pgtable(folio); >>>> - lruvec_stat_sub_folio(folio, NR_PAGETABLE); >>>> -} > > Thank you!