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 96A44C433EF for ; Thu, 10 Mar 2022 08:36:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F07A48D0002; Thu, 10 Mar 2022 03:36:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EB73E8D0001; Thu, 10 Mar 2022 03:36:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA66F8D0002; Thu, 10 Mar 2022 03:36:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id C730F8D0001 for ; Thu, 10 Mar 2022 03:36:09 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9B04223AC4 for ; Thu, 10 Mar 2022 08:36:09 +0000 (UTC) X-FDA: 79227819258.01.5848E76 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 02D364001C for ; Thu, 10 Mar 2022 08:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646901368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SdlbI2z0RghsFTWZjvxfS4BIInXiDN0dAMJn9Yvl9ms=; b=fUGDPckS1LyTA98P1XoovFjZez2bAVZXCzSyXVkem3dj7/xbQjq1ACvckao8jaL67368WY vgv2nW4n5ebHCGbUO+iKU54ZB+i2utDDC+6SdvL/BPmWliYmi5gPREAzpTj9/UnnFZAG06 2tB5wuXMOSducBDHuSsrWBE3clAcvkQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-261-9eGiNJBrPdGKGjjqM56nHg-1; Thu, 10 Mar 2022 03:36:05 -0500 X-MC-Unique: 9eGiNJBrPdGKGjjqM56nHg-1 Received: by mail-wm1-f70.google.com with SMTP id l2-20020a1ced02000000b0038482a47e7eso3783655wmh.5 for ; Thu, 10 Mar 2022 00:36:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=SdlbI2z0RghsFTWZjvxfS4BIInXiDN0dAMJn9Yvl9ms=; b=mW59xIX76seEBJSPRzIBEFPNrgzj+QEIAkBRBofkH2uDzjKyHQWE1u8crZUi+fRv8Z ML52hvkVFXw1JVm3HWAGqDxpivdDdv44go8s/hbaVQ3Okp3CfIea/1a6tGkIEGbtXA68 bFtGtg0gmfXZdu9ac5FvEPxUQkswgdSjJr9m4DJeAf5eep3qwjcKKNDIii6WllnBXsFf esY7V4XEHa/vLkOvFXoR4BrftDVYGoNe11kHucNznxtw77XZeafNP1ITg4ZD0fySWFrM bughLJLBvPO1Vs1i6VFsIb+gtxRS5SzPGvtBu2APqm7mAJP5gPmOdOShLLCyG6F0YWB/ 4S6A== X-Gm-Message-State: AOAM530d/XOgcSjej19Qoh9oww0rCBIVeVHYj9FPyqAGV5cNsPQ1Q7lX 4lS5PKRCDfe+JdkrgIE/qihAT44iQaNQJtQqyvbf7fxzw7xPn9KD2yPXuh51KRcxZzZkqPJHz5r GsHgzPX2KxUA= X-Received: by 2002:a05:6000:1a88:b0:203:8de9:47cc with SMTP id f8-20020a0560001a8800b002038de947ccmr597579wry.182.1646901363981; Thu, 10 Mar 2022 00:36:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0/MVki2Z/ZQZyp83Cw46INv+11717p3ZQf2EERKrA2i3GnigoGYETZX7KVL9NMjBmjgCyWg== X-Received: by 2002:a05:6000:1a88:b0:203:8de9:47cc with SMTP id f8-20020a0560001a8800b002038de947ccmr597565wry.182.1646901363670; Thu, 10 Mar 2022 00:36:03 -0800 (PST) Received: from ?IPV6:2a09:80c0:192:0:20af:34be:985b:b6c8? ([2a09:80c0:192:0:20af:34be:985b:b6c8]) by smtp.gmail.com with ESMTPSA id ay9-20020a5d6f09000000b001f1f3330fc5sm3692426wrb.28.2022.03.10.00.36.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Mar 2022 00:36:03 -0800 (PST) Message-ID: Date: Thu, 10 Mar 2022 09:36:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: Linus Torvalds , Matthew Wilcox Cc: Linux-MM , Linux Kernel Mailing List References: From: David Hildenbrand Organization: Red Hat Subject: Re: [RFC] Free up a page flag In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 02D364001C X-Stat-Signature: cmb1ur3cfeen17eoa37g43dnsczjezxo X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fUGDPckS; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf17.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1646901368-663256 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 09.03.22 23:07, Linus Torvalds wrote: > On Wed, Mar 9, 2022 at 12:50 PM Matthew Wilcox wrote: >> >> We're always running out of page flags. Here's an attempt to free one >> up for the next time somebody wants one. > > Ugh. This is too ugly for words. > > I wouldn't mind something along the conceptual lines of "these bits > are only used for this type", but I think it would need to be much > more organized and explicit, not this kind of randomness. > > For example, quite a few of the page bits really only make sense for > the "page cache and anonymous pages" kind. > > I think this includes some really fundamental bits like the lock bit > (and the associated waiters bit), along with a lot of the "owner" aka > "this can be used by the filesystem" bits. > > I think it _also_ includes all the LRU and workingset bits etc. > > So if we consider that kind of case the "normal" case, the not-normal > case is likely (a) slab, (b) reserved pages and (c) zspages., > > Which is pretty close to your "xyzzy" bit (I think you came to the > same list of "slab or reserved" conclusion because of the fundamental > issues above), but my point is that I think this approach is > acceptable if we make it much less random, and make it a lot more > explicit and thought through. > > And we'd probably need to actually *verify* that we don't do things > like lock (or LRU) those non-normal pages. > Looking at isolate_movable_page(), I think we can easily end up locking random pages temporarily. And especially non-lru page migration makes use of it as well. Personally, I'd not try restricting PG_lock and PG_waiter for specific page types, it IMHO a way to generic infrastructure. Other page flags are different and we already reuse them in different context: e.g., reusing PG_uptodate for buddy pages via PG_reported. -- Thanks, David / dhildenb