Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp6169rdb; Mon, 22 Jan 2024 10:06:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEeFkn2e9pXlNkNXGyrA/3b/oua+kqIpucF+j3vyFdXDDn2d3sdx4oPY1Vg9f3Bvp4tjgHY X-Received: by 2002:a05:622a:188f:b0:42a:31d1:37ea with SMTP id v15-20020a05622a188f00b0042a31d137eamr6403732qtc.104.1705946773103; Mon, 22 Jan 2024 10:06:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705946773; cv=pass; d=google.com; s=arc-20160816; b=OnDF787ZaGm2fhotjHcwnbhICey/O0qIulqfx5dxrmf4dFsKVZdF+xq94pAPOsninj xnQ9911kEUiFPOT3PCihraHmwZEsQQU6+uMZGonrFrfKi/tXrRr/uaLZJKSWOe2IpAq6 K2QMBgY0rRx22/N4v/Z5uRMqtauZ12/yZQHmzKcER+tfuIyxyzn3kdOBJJj6YQU7DZcW WdqXqHmtUzJhrTS6EqXTWgOXYQa4MpXwlFLwMDl3t0yGorsBTsxg6WlwtfQjud0Dh5GG XSCvuY1MRHKa5ZkQAG4jCNyK0foTNUK3bpXCgFq6l3JTrDC6A0ZlE1+lowRxNnzTTwY4 y6cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=fyeouQDBKH3zmSkGCGCweAXt9nnJcaYJ2uGQh02J2OI=; fh=ErFcTQN7f+uQqnHKFOERdgyzHiHHO0CVmPYhhcNaif8=; b=nL0BNJtZlFkTk2YOTVoIFfl/UUCg8Pm14zGVmViud3RU5lj7I/Muf7vy4M6pTVGNZ7 E3WYBtisZIjwwZBpgGIwgbEkSRfBgUTxvE2XXc8JfeNzJyTsF4mnSSGlfigfQpX1rPIT X45lIunOSXOSpvDy7RxtCuktqFM2DP3dPjXCnd9y67skJqvUclQDKaXGHjair0poHSLm Usb72mYNS8wsqY0oh7EUx6QTNnykl9MRxTJkX+bTrZeW+kXGCLlgl/HI86EEK5LOjZBv T1Nh909crVqN7ZbdOUAxNb/LiAvI3HrwKqpIYAhkhqu4S2udT2gy/KrYQQKspekTdZ2E 0DmQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-33813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i14-20020ac85c0e000000b0042a4b6069e1si238132qti.617.2024.01.22.10.06.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 10:06:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-33813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EE8511C296B6 for ; Mon, 22 Jan 2024 18:04:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FDDE63405; Mon, 22 Jan 2024 17:26:06 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB99263400 for ; Mon, 22 Jan 2024 17:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944365; cv=none; b=hAzKWQmLlkQXJAMif4mTiUO6uP1dcAW2kJleTKQf/q49bjUDqh1JYWYYlfq5qxBb9FvsgTccVA2fwb5ngn8u0NtRxFcZjR619eMCUBTMIm+cIPNQl3ZA9ii3Y04S/3ZMF0pu/tGQiCdAGyxVsZHR1z7sLNSRDmb8xlvmjnxEz7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944365; c=relaxed/simple; bh=jEAwPjrNMM6j6iAOQn2Ez7Kg8sSTiCKpeKjzu7KJIP0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=g1RZlmnX623XA2n6l+9vGuNap9+9AvjBshtT0LyXFGXnTslhiZgwKWyaJ5pbDCfHNCxrkAWO7NlMgZhe/HsyJt9zghJo6Giw5XtcZwfdHWYnWW5vgDK+qtrqayiR3w+/SYPWN/s7xgvGg7xKlZ/tSO/TjsOPCpKLAkN67GYT+ow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 607361FB; Mon, 22 Jan 2024 09:26:49 -0800 (PST) Received: from [10.1.33.151] (XHFQ2J9959.cambridge.arm.com [10.1.33.151]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 04EC13F5A1; Mon, 22 Jan 2024 09:26:01 -0800 (PST) Message-ID: Date: Mon, 22 Jan 2024 17:26:00 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 28/40] mm/memory: page_remove_rmap() -> folio_remove_rmap_pte() Content-Language: en-GB To: Matthew Wilcox , David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Hugh Dickins , Yin Fengwei , Mike Kravetz , Muchun Song , Peter Xu References: <20231220224504.646757-1-david@redhat.com> <20231220224504.646757-29-david@redhat.com> <2445cedb-61fb-422c-8bfb-caf0a2beed62@arm.com> <007e83fa-16c7-4700-b326-ee8cb7809f9f@redhat.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/01/2024 17:20, Matthew Wilcox wrote: > On Mon, Jan 22, 2024 at 06:01:58PM +0100, David Hildenbrand wrote: >>> And folio_mark_dirty() is doing more than just setting teh PG_dirty bit. In my >>> equivalent change, as part of the contpte series, I've swapped set_page_dirty() >>> for folio_mark_dirty(). >> >> Good catch, that should be folio_mark_dirty(). Let me send a fixup. >> >> (the difference in naming for both functions really is bad) > > It really is, and I don't know what to do about it. > > We need a function that literally just sets the flag. For every other > flag, that's folio_set_FLAG. We can't use __folio_set_flag because that > means "set the flag non-atomically". > > We need a function that does all of the work involved with tracking > dirty folios. I chose folio_mark_dirty() to align with > folio_mark_uptodate() (ie mark is not just 'set" but also "do some extra > work"). > > But because we're converting from set_page_dirty(), the OBVIOUS rename > is to folio_set_dirty(), which is WRONG. > > So we're in the part of the design space where the consistent naming and > the-obvious-thing-to-do-is-wrong are in collision, and I do not have a > good answer. > > Maybe we can call the first function _folio_set_dirty(), and we don't > have a folio_set_dirty() at all? We don't have a folio_set_uptodate(), > so there's some precedent there. Is there anything stopping us from renaming set_page_dirty() to mark_page_dirty() (or page_mark_dirty())? For me the folio naming is consistent, but the page names suck; presumably PageSetDirty() and set_page_dirty()... yuk.