From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 E95311DE4C2 for ; Mon, 6 Jan 2025 13:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736169807; cv=none; b=rbAKrB3VR7rcujWztegnRX5uAvTQj4by+b5YILReDDr+e7RkQKFJZsVX36MMawJ/aKoAz5/XFYJpmvfLHZ/tonYOm7+b63QjxaomcPBATHrML+F9hQe91+nKbI9XhEtCEORH289NdttFl8BEaFNYI1Xg90EGT6FdbnlOLrbh68c= 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.173 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-f173.google.com with SMTP id d9443c01a7336-216728b1836so186444715ad.0 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=MXp3lY2ItW6zL7Cdfr5zfX69LYIHVqi4rpwkUCkLfs/8hIiO6j7hV93j2LZ/SdIC5L 3a1THK2CdORL/px1AnAFG3VRbbSeGAZwH5Nlq1S9sLLC2/0oCd8SJ5ACEzMoYnkU4Ur4 Kih5GPCIjNm4LrgqMHZ9W/8wjOCyM0yb0D8td2+2fwIniSRMUEBdpI9Apmo4jbxc+6iN bAb80Un7PgqhszAKYZWZBIGpXVha5H7xA3B6AqJoGe+61xzUv6R1vgKuzhlq0eKLmKQa Arw4Wn80QRlownNtJ000YY0lHdNPo864oy5NOXdEjOuuNGZOSJT/Vag0O8fIupqK9dAc uJUQ== X-Forwarded-Encrypted: i=1; AJvYcCU73ylbJ4zRB7voanwde/GK0AloDsvNMnnEGqtwCDsvz0z3G/vNT9mACVEp4kccOud/tG8GC8SODbQ/@vger.kernel.org X-Gm-Message-State: AOJu0YySPiF5qMf6wO6qXEiv51+CWhRRO+DJAGyuz+zzcuX9AVm9BSu9 ftmsseQ3M4EdlhbXMByKVKpt2cR2ihy1eQm156alT0E1wOrpfg1KHlmFvzcg+o4= X-Gm-Gg: ASbGncsFHv8i7OORemlkRajRoGizYu8IiCCujA3YIsR19pQspgvLOGtYdib7CGAfxdK sVEdCpx6UL3KRIBebcD+Nn1iwzZvwO/CNGTH3mjLhjkTrgwp6o94R1JWvhdKkN6j8KmG7KRpFkF wzExV70FubH1OKndurRNYCOXUAy3DDoXrIEDUxNGIFV2w7mVFRhKVfMw77r1+rTO7vCazHdYFbb 552R3mO+0XgOLy+S2OQxDXGV12moY+hQGZL+vvi1/4JJfT6EKY7p6r8PzQzpvK9L84ug70Tp2VP 2xNXpzYyS09axVSsY2y6d3iwxB4uDB8eJ1/1SKbohhkzODRweb5r 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: sparclinux@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!