From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 991F5C433FE for ; Thu, 9 Dec 2021 15:18:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7F206B0072; Thu, 9 Dec 2021 10:18:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C2DB46B0073; Thu, 9 Dec 2021 10:18:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF5966B0074; Thu, 9 Dec 2021 10:18:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id 9D8C66B0072 for ; Thu, 9 Dec 2021 10:18:28 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5E8678245578 for ; Thu, 9 Dec 2021 15:18:18 +0000 (UTC) X-FDA: 78898611876.29.27F7097 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf13.hostedemail.com (Postfix) with ESMTP id BF0522000C for ; Thu, 9 Dec 2021 15:18:16 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id x15so20965368edv.1 for ; Thu, 09 Dec 2021 07:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5iLRlZbJOhFJD4EQnidHmyuZneL5KPibp0BnEDW6M4E=; b=XKxrG505Sz1sZS8PCxd1z/+1G9hIWyBeHrpW/RGRkYyXmm6hiPJhblWxflzSu4LFqG iqpjEgy0taT+ew3UUT4qvw4Dr21XYT55fCWa2WGjYRTvUK+Cig11U6IveF6Tgued8h1+ g8atBQ6kTRWGPou4+2dAHdJ1afUKqCohQrqU11Ct/RA1PZUuXO6MsDEI+vnsVeFcIZEB gfCBkmYq05XNPAbBDL8yMKvAljbhOMaoFqF/NnsU4HwFTc5Rb81ualaP5HEtld9DDX5I r7/bM11AMehkrpQUF1WSOgRIWgYI8ld0JyDT98uc4v2Uj7ifdVz5t9T9BDjxVaPD0P+3 0T6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5iLRlZbJOhFJD4EQnidHmyuZneL5KPibp0BnEDW6M4E=; b=yv890T6xMmCr/FadWXYAzwLvonMOaRzoER5RM2WpKDkQrzBsdmRZPpgEgiSczv+gdx Zx0TiKsRDjyC6zFrcwzwqHK6NDI0fut4jSmHI1kY99Ky7//N+VWKMNjU9Z6mu1VLr9+e kNGIQZ+qO3pzzXs+OjzyjHZjJCamjQ+zKqKemXvt1dZ8ZcUKLVTuvXUh7GLE8e76V/OJ FqPVAocx2sxSzo7Den+go23CbOUduASVkEVtkl3YMcFpDo4NsspGSB2Jtb9TI+nTkyOd dHkVSoLcMiOhpscMf0IieWPPXDCR1fGRYTv1LRnBwqYf/Q75NLQ856YgbUyVpUSfGCV4 tMsg== X-Gm-Message-State: AOAM533OxQTRDQpe6V0DQ52s5PKhkxjVZNQIbY/SZ/p5V/mdFwPY04Za 5bGJQizF0rRWCt3oJaNlbcyx3uOC268ii8yXDtwWFA== X-Google-Smtp-Source: ABdhPJwPXyWfT49E05oQInkSdO194qjrWNF44bvD1ZcSTHL7E7581f+iLrsjJJxu6vli7hBtpZ4WRsKKg47fYbK4fso= X-Received: by 2002:a50:d74e:: with SMTP id i14mr29231311edj.243.1639062996948; Thu, 09 Dec 2021 07:16:36 -0800 (PST) MIME-Version: 1.0 References: <20211208203544.2297121-1-pasha.tatashin@soleen.com> <20211208203544.2297121-2-pasha.tatashin@soleen.com> In-Reply-To: From: Pasha Tatashin Date: Thu, 9 Dec 2021 10:15:59 -0500 Message-ID: Subject: Re: [PATCH 01/10] mm: page_ref_add_unless() does not trace 'u' argument To: Matthew Wilcox Cc: LKML , linux-mm , linux-m68k@lists.linux-m68k.org, Anshuman Khandual , Andrew Morton , william.kucharski@oracle.com, Mike Kravetz , Vlastimil Babka , Geert Uytterhoeven , schmitzmic@gmail.com, Steven Rostedt , Ingo Molnar , Johannes Weiner , Roman Gushchin , Muchun Song , weixugc@google.com, Greg Thelen , David Rientjes , Paul Turner Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: BF0522000C X-Stat-Signature: sxgg9z4woq8f7kghj1ksn5bjc3ezjcwa Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=XKxrG505; spf=pass (imf13.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=none X-HE-Tag: 1639063096-865289 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Dec 8, 2021 at 9:17 PM Matthew Wilcox wrote: > > On Wed, Dec 08, 2021 at 08:25:22PM -0500, Pasha Tatashin wrote: > > On Wed, Dec 8, 2021 at 3:55 PM Matthew Wilcox wrote: > > > > > > On Wed, Dec 08, 2021 at 08:35:35PM +0000, Pasha Tatashin wrote: > > > > In other page_ref_* functions all arguments and returns are traced, but > > > > in page_ref_add_unless the 'u' argument which stands for unless boolean > > > > is not traced. However, what is more confusing is that in the tracing > > > > routine: > > > > __page_ref_mod_unless(struct page *page, int v, int u); > > > > > > > > The 'u' argument present, but instead a return value is passed into > > > > this argument. > > > > > > > > Add a new template specific for page_ref_add_unless(), and trace all > > > > arguments and the return value. > > > > > > The special casing of '1' for device pages is going away, so NAK > > > to this user-visible change. > > > > I can drop this patch, as it really intended to fix existing oddities > > and missing info. However, I do not really understand your NAK reason. > > Can you please explain about the special casing of "1" for device > > pages? > > $ git grep page_ref_add_unless > include/linux/mm.h: return page_ref_add_unless(page, 1, 0); > include/linux/page_ref.h:static inline bool page_ref_add_unless(struct page *page, int nr, int u) > include/linux/page_ref.h: return page_ref_add_unless(&folio->page, nr, u); > mm/memcontrol.c: if (!page_ref_add_unless(page, 1, 1)) > > 'u' is always 0, except for the caller in mm/memcontrol.c: > > if (is_device_private_entry(ent)) { > page = pfn_swap_entry_to_page(ent); > /* > * MEMORY_DEVICE_PRIVATE means ZONE_DEVICE page and which have > * a refcount of 1 when free (unlike normal page) > */ > if (!page_ref_add_unless(page, 1, 1)) > return NULL; > return page; > } > > That special casing of ZONE_DEVICE pages is being fixed, so 'u' will > soon always be 0, and I'm sure we'll delete it as an argument. So > there's no point in tracing what it 'used to be'. Sounds good, at the time when 'u' is deleted we can also address inconsistencies fixed in this patch. So, I will drop it from my series in the next version. Thanks, Pasha