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 X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71B0FC2BA19 for ; Tue, 21 Apr 2020 09:51:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 049E42087E for ; Tue, 21 Apr 2020 09:51:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 049E42087E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8B12B8E0005; Tue, 21 Apr 2020 05:51:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 860EF8E0003; Tue, 21 Apr 2020 05:51:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 776358E0005; Tue, 21 Apr 2020 05:51:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 5CCC88E0003 for ; Tue, 21 Apr 2020 05:51:07 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 23BACE0A7 for ; Tue, 21 Apr 2020 09:51:07 +0000 (UTC) X-FDA: 76731393774.08.rake33_60e46b4e90130 X-HE-Tag: rake33_60e46b4e90130 X-Filterd-Recvd-Size: 2130 Received: from r3-24.sinamail.sina.com.cn (r3-24.sinamail.sina.com.cn [202.108.3.24]) by imf35.hostedemail.com (Postfix) with SMTP for ; Tue, 21 Apr 2020 09:50:58 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.253.228.166]) by sina.com with ESMTP id 5E9EB8800002A3FC; Tue, 21 Apr 2020 17:10:25 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 68361054919699 From: Hillf Danton To: Johannes Weiner Cc: Joonsoo Kim , Alex Shi , Shakeel Butt , Hugh Dickins , Michal Hocko , "Kirill A. Shutemov" , Roman Gushchin , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 18/18] mm: memcontrol: update page->mem_cgroup stability rules Date: Tue, 21 Apr 2020 17:10:14 +0800 Message-Id: <20200421091014.2180-1-hdanton@sina.com> In-Reply-To: <20200420221126.341272-1-hannes@cmpxchg.org> References: <20200420221126.341272-1-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 20 Apr 2020 18:11:26 -0400 Johannes Weiner wrote: >=20 > The previous patches have simplified the access rules around > page->mem_cgroup somewhat: >=20 > 1. We never change page->mem_cgroup while the page is isolated by > somebody else. This was by far the biggest exception to our rules > and it didn't stop at lock_page() or lock_page_memcg(). >=20 > 2. We charge pages before they get put into page tables now, so the > somewhat fishy rule about "can be in page table as long as it's > still locked" is now gone and boiled down to having an exclusive > reference to the page. >=20 > Document the new rules. Any of the following will stabilize the > page->mem_cgroup association: >=20 > - the page lock > - LRU isolation > - lock_page_memcg() > - exclusive access to the page Then rule-1 makes rule-3 no longer needed in mem_cgroup_move_account()?