Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp590485pxb; Tue, 15 Feb 2022 23:04:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEZn6GLwv30i12Ygf+TD41+Qq8Hk6+EqiE+/JjzShMdAg3vizU0BSb9CJtpWUY2CLeV936 X-Received: by 2002:a05:6a00:188f:b0:4e1:a253:850c with SMTP id x15-20020a056a00188f00b004e1a253850cmr163462pfh.61.1644995096826; Tue, 15 Feb 2022 23:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644995096; cv=none; d=google.com; s=arc-20160816; b=GCtMSdGYGjngQzmbK6m/DV3KiNuMCnMg1EsPeTefqk/p1aGZEEK2SMDpkDq+k8G+Cz 22bLSOWMCpT7h1MVtUCkk6nyNV7SVXUgE6zHNUdIKaB1Sac1V6FWvf/q3g/V+6J5ZmMF t1ze3+fHj+BXpyzu9dZ6zecLg2eojS2oQtZHkxb0Ys4HTa5ir1igRstoFM5tph7p/KF3 WP9uYgcA9M0YdZw+yaOsrH6Bq5bpVYkNtToVUQm5DozRNelXvpThfmhq7/fFrJO/SFD9 ARxAayfW5uxSjpAFiekHcdQZCdpcwKxyMqg6BrNbUEoz8nYNeSDQcHHsue2HNHAOLdZ+ C52Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PcDFt5b9r6iGncybJUkp80gOtRNm+YuPdYaT6WiL4VE=; b=W4Jx/IKizrYPH0JoPZKK/Cds8U9c23/SlKOAOLaOjMKV6yT6ZbnlXk5rDsc4ZNzYRr HDtnKBShq/M2+lzMPIR6qxkI8k/xIb9oAkUeXRP+ZBcWNgRfVhEISXLItrwq91woSVb/ Og0+XKxSpIMQcdCIQud44pkEt9SAhu+Xw+EUv449JafNeAjG+Ru34r76FTMp/jFU7zZd Vam6iyQ2oBfDhkaCD7ePoWe7WAYuMHH73kYF3J3BP3zGh2p4sLPRg2IjkpX+9Lwd3tbR lZ98O6GWpS0/tSb8eYMI/rR+91GV4Lzan+mTCvyWGEagZw3cnilfgsKY9KDrfOn0qRsV dC7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vSsWSska; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id pc9si19762078pjb.3.2022.02.15.23.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:04:56 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vSsWSska; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51B4DA2F2F; Tue, 15 Feb 2022 22:42:24 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241785AbiBOQlR (ORCPT + 99 others); Tue, 15 Feb 2022 11:41:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233493AbiBOQlQ (ORCPT ); Tue, 15 Feb 2022 11:41:16 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06FAFF212D for ; Tue, 15 Feb 2022 08:41:07 -0800 (PST) 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=PcDFt5b9r6iGncybJUkp80gOtRNm+YuPdYaT6WiL4VE=; b=vSsWSska5vRI2Or64pkY00wKxf WEy3JiVQNFITbMmotguhLRRUx9qrpXGJxRv9afMSqTRP5WKnZ9Oiyuyb8T/7ARFWhxIYm0rCKOBMI ua6+YYDGOIJnsTCPyStQlHauU3GscK7VyKwGWq6qFI2ZAb7dXNuz+rRmsUxhy/I3KmAAuzUON5uVP Kwj1kEcYxdEhHTS7u6iJ0mefNijE/SY5/yXZaTuN8Ub18MBvvgZzL1T43HP25+0yCAijVmWrodOtW Wbih0AMcw7oqym1cffYKOUiYP8/PIgmAXEU4m7QOUoYNwyIQ2vIQ5LZsCzZb2RNB2KxyxHzIK6daX 6ZK1+xbQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nK0sh-00E0D7-Rg; Tue, 15 Feb 2022 16:40:47 +0000 Date: Tue, 15 Feb 2022 16:40:47 +0000 From: Matthew Wilcox To: Hugh Dickins Cc: 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 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 Content-Disposition: inline In-Reply-To: <1abb94ee-fe72-dba9-3eb0-d1e576d148e6@google.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)