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 72435C433EF for ; Tue, 15 Feb 2022 21:02:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C56166B0078; Tue, 15 Feb 2022 16:02:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C04606B007B; Tue, 15 Feb 2022 16:02:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACD186B007D; Tue, 15 Feb 2022 16:02:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id 9EA2F6B0078 for ; Tue, 15 Feb 2022 16:02:44 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 62E208A3C8 for ; Tue, 15 Feb 2022 21:02:44 +0000 (UTC) X-FDA: 79146238248.26.2CC8D43 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by imf02.hostedemail.com (Postfix) with ESMTP id E71E580006 for ; Tue, 15 Feb 2022 21:02:43 +0000 (UTC) Received: by mail-qt1-f178.google.com with SMTP id q20so74037qtw.8 for ; Tue, 15 Feb 2022 13:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=RojO1s2ebF9xxfjFY1vNZc8Wc0/GmbtOgVpxelDT3Es=; b=AOrHTegYpuTN0vWbGZ1zxEfaoRq+Xa3pSQhdj+hxe4QWQwOovJklU1Mac1cCs3LQ0E fAwrLmAeXlKCWaMrZgtHQJhel53qFAYRkdna73DjH1w4LAVndwouTOG4MbFFYCCL9Y2f Ju+QjlMsHFz2W6zLiwmavEQqvXNNqMUi9K0GHLEGKnHCWKfa5bY0F9HnbJOJuMe8wyQ6 vbU5PaZEeQFFD1ftF2g6k0wg0girLYJ395HGrjmUTR1Oj/eMSEYxsPlRnzDqZj6k80qO hoIoLJdKaSmNMp9Xdlr/aDqr53+r4k95Msf1pTf6zDgDZqsJ2koKU2Ds3jSPjxk4BjZN n1Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=RojO1s2ebF9xxfjFY1vNZc8Wc0/GmbtOgVpxelDT3Es=; b=hXOs7c0dVraHO5H5tf7JNxPmxyN3PzMa9GWtPtGLTOerADPyZVG01rJaRxw/Q482ZK kpDGeOHAjt3ngDZbPYoVmCsb3Y8pJohkOHwnHR443kX70JT4Fz2R/b7472MhJH1/IgRB Hk++5A2a6NQF+KGr0vYegfQd2527SQlipsaa0OjvT/cuDfmLY8y5Qa3va2u/D4KXU36d yEfqDCuRKkJ19qeb0cDhOUGmFmI7BvKcVI7yPJqnD4iXTndAQGn1TFr0N6LVjFHj6FOY WuI6PqPBOapjLRt8u6VWK5nIQcW54EK0y4zQi4DLpjl0RvO30f/n+x/+hgTntmn/vMAC V+jQ== X-Gm-Message-State: AOAM531jOHNWnFkw68JNQm8CoWSHHQpF4fhg3705qYYgTB/B/NVT1Bhp oNJRVYh3uh7mzAjxyQYmJ4Wdgw== X-Google-Smtp-Source: ABdhPJyYLAdLBtClvESalRU/1PMX028+T47koEhg36b0JuJd2M9G5i3e6iZxz5oKrtS2SdUrsWnRug== X-Received: by 2002:ac8:5bc8:: with SMTP id b8mr643716qtb.428.1644958963064; Tue, 15 Feb 2022 13:02:43 -0800 (PST) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id p15sm20735921qtk.56.2022.02.15.13.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 13:02:42 -0800 (PST) Date: Tue, 15 Feb 2022 13:02:30 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Matthew Wilcox cc: Hugh Dickins , Andrew Morton , Michal Hocko , Vlastimil Babka , "Kirill A. Shutemov" , David Hildenbrand , Alistair Popple , Johannes Weiner , Rik van Riel , Suren Baghdasaryan , Yu Zhao , Greg Thelen , Shakeel Butt , Yang Li , SeongJae Park , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 10/13] mm/munlock: mlock_page() munlock_page() batch by pagevec In-Reply-To: Message-ID: References: <55a49083-37f9-3766-1de9-9feea7428ac@google.com> <1abb94ee-fe72-dba9-3eb0-d1e576d148e6@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E71E580006 X-Stat-Signature: soge4u933set8gnfmycrnqpapkogwapy Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=AOrHTegY; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf02.hostedemail.com: domain of hughd@google.com designates 209.85.160.178 as permitted sender) smtp.mailfrom=hughd@google.com X-HE-Tag: 1644958963-26040 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 Tue, 15 Feb 2022, Matthew Wilcox wrote: > On Mon, Feb 14, 2022 at 06:37:29PM -0800, Hugh Dickins wrote: > > +/* > > + * Flags held in the low bits of a struct page pointer on the mlock_pvec. > > + */ > > +#define LRU_PAGE 0x1 > > +#define NEW_PAGE 0x2 > > +#define mlock_lru(page) ((struct page *)((unsigned long)page + LRU_PAGE)) > > +#define mlock_new(page) ((struct page *)((unsigned long)page + NEW_PAGE)) > > You've tripped over one of the weirdnesses in the C preprocessor here. > If the variable passed is not _named_ page, it gets cast to a pointer > to a struct of the same name as the variable. There's no way to tell > cpp that that 'page' after 'struct' is literal and not to be replaced > by the 'page' argument. > > I'm going to change this to: > > static inline struct page *mlock_lru(struct page *page) > { > return (struct page *)((unsigned long)page + LRU_PAGE); > } > > (mutatis mutandi for mlock_new) Okay, thanks. (You're not naming your folio "page" :-?) Hugh