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 13169C433FE for ; Tue, 29 Nov 2022 19:43:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A1216B0071; Tue, 29 Nov 2022 14:43:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 951506B0072; Tue, 29 Nov 2022 14:43:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 818E46B0073; Tue, 29 Nov 2022 14:43:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 702546B0071 for ; Tue, 29 Nov 2022 14:43:07 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 35E4C120320 for ; Tue, 29 Nov 2022 19:43:07 +0000 (UTC) X-FDA: 80187503214.12.CF19F0C Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) by imf10.hostedemail.com (Postfix) with ESMTP id DE45DC000B for ; Tue, 29 Nov 2022 19:43:06 +0000 (UTC) Received: by mail-yb1-f171.google.com with SMTP id l67so18861122ybl.1 for ; Tue, 29 Nov 2022 11:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rGTIG8x4KsRIPh4QmKAiIuwOVCN06VOhOfE/clNYHVU=; b=iCbO4c3ISsWAsryVLUOqcvzYLYwMoYxQScIi5QhG+vvlujDo7VmIfHe0IA52ZQutMK amwKaZjJTL6PsYXcJVsqFVkIuQuyfovT0EWhapOAzn55PBiHbsC7HdJwIyN7CT9cHI8x VVZ7qVmQsKNXg3E+ebb0Guqg0H9F0i7pEexuw4OPdde3Ed8SN8zyNmPjSnSHOukHyEji kacPnsnMaugQ7P40hIuhkUOARS0JEquiN/xd2Hs8T1HKzZZSa7CNXyUSZaMrgWMBJVZL w7tgyMF7w6NMxVOxYy7wSc/DUJxU6gOhmqnNLv9/F87H2osfOzzasLTlcfRsHXVbcWTx 9MaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rGTIG8x4KsRIPh4QmKAiIuwOVCN06VOhOfE/clNYHVU=; b=B55Ppzw53Tyxd+yqFfFaO+Oqi3yI/mTK556i7mXhUATDUHRUKBkKnFupHlA4Kn//G4 t7WpuUxz85zvaKDVWbWhbdGQIQEkMRTKL62EjTcqZjPWcFNkj/sh+Dud4oYYAK+Yjfkq YWZ0yG4qKBi18lElXZXNJ1auILr8WwFeoyhvrbrRG8KNo1MQk1UjBAPWcyfB5GQFGrdp EFWgIM7xTqmToj40+AWTcxM+9nyR9zvnNiZslK3pqBe3DhObDLt8Gmb0dVkGensXz683 Fyv5d1bIwCV+x1VaEEvNSUJN4nCb3R8mmx8/bOHaPv1/lE5gM8kmQLUhjbnYxv/OuRvd hEYw== X-Gm-Message-State: ANoB5plkawNQTiNogUl/MahGCt9AIuUJQuL3msGobsN5THuMgFYoq0jN kKI2RX/Hc5CzZVPxMBhbnufWPmHg3ByJuqh3NzTzsw== X-Google-Smtp-Source: AA0mqf4iDf8S7ORhxxAnl4qKRbvnYF7NYF/WG8Q+uwr3FmLDMgQ2VEFjlHXPYDd+yFVJQeFNluEJWbqsm9x72Ne9QT8= X-Received: by 2002:a25:909:0:b0:6f6:e111:a9ec with SMTP id 9-20020a250909000000b006f6e111a9ecmr10937713ybj.259.1669750986030; Tue, 29 Nov 2022 11:43:06 -0800 (PST) MIME-Version: 1.0 References: <20221123181838.1373440-1-hannes@cmpxchg.org> <16dd09c-bb6c-6058-2b3-7559b5aefe9@google.com> In-Reply-To: From: Shakeel Butt Date: Tue, 29 Nov 2022 11:42:54 -0800 Message-ID: Subject: Re: [PATCH] mm: remove lock_page_memcg() from rmap To: Johannes Weiner Cc: Hugh Dickins , Andrew Morton , Linus Torvalds , Michal Hocko , Stephen Rothwell , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669750986; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rGTIG8x4KsRIPh4QmKAiIuwOVCN06VOhOfE/clNYHVU=; b=3/lEwN5mDIFUD2rxvHxd3PvXqNqW5syX47M3KtqICZ52APUTXYyp+S1QChIjgAvNX5nn4p zdRVa9Wh6VbIDuET4+CCoGhSExH/TcCg5LSK2Pkhgjbd+yltqOuZdd31j8sb89JyFE6nXx LNRmKT+hk+1fPSbNgeO4MPIMaD2SVNE= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=iCbO4c3I; spf=pass (imf10.hostedemail.com: domain of shakeelb@google.com designates 209.85.219.171 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669750986; a=rsa-sha256; cv=none; b=mNoVZJJ9RYj5Cw3QBkmj0Y8fkFE4vDBzH6Tuns4X63k2q3rsZHchmZDI4fYtQL6F/b577U GhbLTD0POttENkL2RqwAU4tfRHXFpEt132Mm/IKLfSEOpt1gbCZCsePvNKOtSiZBHj/r6j /CWVJsa0xeTbyAPAThSiA6uJ9L5L41k= X-Stat-Signature: wrqdbh8cwkz4u95p1rzdumd8xxtgmiqc X-Rspamd-Queue-Id: DE45DC000B Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=iCbO4c3I; spf=pass (imf10.hostedemail.com: domain of shakeelb@google.com designates 209.85.219.171 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam06 X-Rspam-User: X-HE-Tag: 1669750986-797717 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, Nov 29, 2022 at 11:08 AM Johannes Weiner wrote: > > On Mon, Nov 28, 2022 at 11:59:53AM -0500, Johannes Weiner wrote: > > On Wed, Nov 23, 2022 at 10:03:00PM -0800, Hugh Dickins wrote: > > The swapcache/pagecache bit was a brainfart. We acquire the folio lock > > in move_account(), which would lock out concurrent faults. If it's not > > mapped, I don't see how it could become mapped behind our backs. But > > we do need to be prepared for it to be unmapped. > > Welp, that doesn't protect us from the inverse, where the page is > mapped elsewhere and the other ptes are going away. So this won't be > enough, unfortunately. > > > > Does that mean that we just have to reinstate the folio_mapped() checks > > > in mm/memcontrol.c i.e. revert all mm/memcontrol.c changes from the > > > commit? Or does it invalidate the whole project to remove > > > lock_page_memcg() from mm/rmap.c? > > Short of further restricting the pages that can be moved, I don't see > how we can get rid of the cgroup locks in rmap after all. :( > > We can try limiting move candidates to present ptes. But maybe it's > indeed time to deprecate the legacy charge moving altogether, and get > rid of the entire complication. > > Hugh, Shakeel, Michal, what do you think? I am on-board.