Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2073373rdb; Sun, 4 Feb 2024 14:00:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMVn27PkBBltdxsyP7CuKiG0HO91KC9s5DD/ceqb02+RCn77JgxdBVIPhhD55/kF5DOZl9 X-Received: by 2002:a17:902:6b49:b0:1d8:ae30:eddd with SMTP id g9-20020a1709026b4900b001d8ae30edddmr11265461plt.23.1707084024081; Sun, 04 Feb 2024 14:00:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707084024; cv=pass; d=google.com; s=arc-20160816; b=ffbD++rtSq3ce0lL/6bAaVlyj5I7EzMKC5Nn2N4Zy0ckitdHSPV++p37YeAqChI3Pt nn53uqD1Vdm0g8cVtmxDZkgY1uE8HaFQUmcVwohzXk9UUyq02t1btP8Uvf0Uw+6itsHa NvUH2kwrM2TmiDwIqkZ4JnHvngf315LyUdQfzGL8smPcsw02R8ws05oPHKQ88Gk9t8Th QKqOnQNXtT9xGScwjWUG9eBY5u6D0ULfYb+MQ5A3DQyUg3JnvdGWxJqNAl68103yJQGW 5knenJrY1y4blVodYjyqY99MNYHpePF4gVv62twyxQ8kxylqvbcUhgREi8zzqjXuBStH WU2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XXrjFlXGwGKdyrGaQ+qk99Wr2RMFYX1C0OGJy7bKAAw=; fh=8FHDV/4oe8kh26i9QsbhV+UDi3H4EWhwmej0PGIFC/o=; b=dfEtCn3x5cHt3Zh1K4RlW0OlHDBjKT92RyHEVoXWp75su5ObJy7IseNwcRyP6ydgdT VN2K5pmS3FAuRXwt3wcxO+y26HDuZ9KtRSXfk8qNlZKTllTCRhkogWbZdJV2L7zvt7f3 +S6mBzengJGgSfgmo+p27CctokMMJOM1zZVF6xHw1y/WaWCtY8LVInX7PySKuFLulb/2 BeZFo/wzZKSJjFAKIAIBCSTyDDnkfusdt3ZDvz2MBjbCRHf4nyZyzzaYJfNhZ906Rmlm CtVapm5r8FWau/zoL+d9LO8Uo/qtmdtkY0eu9qFFSZjzoq8kIowS+2vN9G+KQ/HmcwZM J02g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="EO/BA6k6"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-51849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51849-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXXmNH4UVNr5lqtOKGDFXauWPBA/uulCQaTQuGCyBzIjUWh3Nsh19TBSaSN+MRFVxsnvks8vtPo9SW00yupeb9UmKwqAA0bwdysjLzKGQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y19-20020a170903011300b001d8e7a40d21si5084407plc.425.2024.02.04.14.00.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 14:00:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="EO/BA6k6"; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-51849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51849-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A8EBCB21037 for ; Sun, 4 Feb 2024 18:54:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8379324B5B; Sun, 4 Feb 2024 18:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="EO/BA6k6" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2966249FA; Sun, 4 Feb 2024 18:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707072855; cv=none; b=Qmc1PwJTe3Cmf0aUEfBoe1O8l/qgSddHilddPbsv3lpzFFE823FyRlxhZQjKdOFckV3+SOvBEu3bCRtPASE2aZsm6nvrtwY9GL5aBXcvVK2unbTfMXl44LiR0lzG3vzkblMWt7vuP0lraERil9jCwZQqOC3aEVN1ntCCoKWfNxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707072855; c=relaxed/simple; bh=IJAzeDQLc2l4aENFMXWZuKCnfgjMkL1wsmTB76NTmUI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IAgkcyWBtkBTdviZYx/+w6i4DlalUP35C7yp83w17+wC4o6QkkYbdrRtWjLcHAAEN1UsfiJRNYfJONl0hNAHXGlfj4zBm+3xd2/gqHpjSA8IWiJFGBjCLvWREE7QSypaqsC5DzFY9Cj6kdmsaRhzUyKYMRhCKqdhqnUuZPrLXX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=EO/BA6k6; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org 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=XXrjFlXGwGKdyrGaQ+qk99Wr2RMFYX1C0OGJy7bKAAw=; b=EO/BA6k6hMbO7NUbSRSR5ZNvIW JvJ0pW5JNr+Ne6AU9edFWfO+G9cnmWETdhiazQA/fd2n6EkVNjVGEbFczv9qmxawMD/I2/mKizTKs s/e5iatw2Gmna5ErsmkyJ6M+NnE9Hh8hxsOeTUZ8bmsS6fKCGSqc7eJr3JBnMSAud/jWlNGBaRTnO y1Eemis9HWQWB1mzDrcWwX31HJKvwRUWl8OxKjCfq5CErc6LF8r9xi7qc9KntHjmAhIr4MQkH1rX8 aDffoUWcBSVUKC24FkUhEki7iXambEBeXIq2O5aVSnQqC2PC5HzWBaogZMLSTiknCi0GNUTNXvG0R AksWKU5A==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWhd1-00000007KOd-2yaf; Sun, 04 Feb 2024 18:54:07 +0000 Date: Sun, 4 Feb 2024 18:54:07 +0000 From: Matthew Wilcox To: Qi Zheng Cc: akpm@linux-foundation.org, arnd@arndb.de, muchun.song@linux.dev, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 2/2] mm: pgtable: remove unnecessary split ptlock for kernel PMD page Message-ID: References: <63f0b3d2f9124ae5076963fb5505bd36daba0393.1706774109.git.zhengqi.arch@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63f0b3d2f9124ae5076963fb5505bd36daba0393.1706774109.git.zhengqi.arch@bytedance.com> On Thu, Feb 01, 2024 at 04:05:41PM +0800, Qi Zheng wrote: > For kernel PMD entry, we use init_mm.page_table_lock to protect it, so > there is no need to allocate and initialize the split ptlock for kernel > PMD page. I don't think this is a great idea. Maybe there's no need to initialise it, but keeping things the same between kernel & user page tables is a usually better. We don't normally allocate memory for the spinlock, it's only in debugging scenarios like LOCKDEP. I would drop this unless you have a really compelling argument to make.