Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1166871ybg; Thu, 11 Jun 2020 02:44:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1lCqEhz6RFIl6RC/UxIYlPPtQKI9SqXhgLKiPCYmWOohD7zF5AvdjSVPufPKVLVFRI/it X-Received: by 2002:a17:906:2a4d:: with SMTP id k13mr7887893eje.253.1591868695783; Thu, 11 Jun 2020 02:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591868695; cv=none; d=google.com; s=arc-20160816; b=shUKOGXPxQ/jBWg/WSyenItuyQYSG4SfNRQDyW+nRFX4lzkAU6V/OGzQ8ZyZo7yjMI csj2e+UO0dBN+5EWRwHAFrrBts13+eMfu7Oy9ZNFJUPvmBiXihX+99MkaX4/uofI6hvQ lfLsqa0vUvh08nNKq3pTSo0mhp3AnEvp7M0uVOhLo0smv9cjkXmK6r3ewypyjR6dDziD VJJH4rZQBOJK87o4yIs3WdhaJg6+7PZAGENGY3Dgw4WzrMkU2Vpjw43YyiEBHj4cTRhP +WwB5SuK5yy3TrpyNkQ+2OmhSO2vcw/qr4yPLWO1iYdfU6Cc5vhcdIV8LpXPT1GPTLdg R1Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=A7As6uSYKJIDVnQAAEPQVgwwIZgTE5NFEu/RzVDwggs=; b=yRWPisaWYKNCrCqRG62sLI5FRtwYA26JzyFyAsR7bflvG/u+2AQenduO7+tMG862fU UlmytnnKcsYJxKtnxl0zbgk7XSGJxAfmU+xYXuQ6Vs4NiwijXVZpdszg6lAu/EB6jxq3 lmSmcawHWOZrYazK2VQaEAqRHBsetTmO2F0aKxXUgDr9QM1Qpww75zwM/D5o8RDOPpPb zT9rm/j956DfZRq/Jly9ju8sfTjhYLdEPlDmsicO2VbXL5HgLVGHA4FHM+is2u3IADcF kxtkKEMEiOYvF7+AF5cWn7uGgorHl0Uyo6a6riyGbBuiQDGT2mnk56hYD/r1qmNyD8N9 Nc/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si1358414edm.63.2020.06.11.02.44.33; Thu, 11 Jun 2020 02:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbgFKJkh (ORCPT + 99 others); Thu, 11 Jun 2020 05:40:37 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54587 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726693AbgFKJkh (ORCPT ); Thu, 11 Jun 2020 05:40:37 -0400 Received: by mail-wm1-f66.google.com with SMTP id g10so4340760wmh.4; Thu, 11 Jun 2020 02:40:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A7As6uSYKJIDVnQAAEPQVgwwIZgTE5NFEu/RzVDwggs=; b=r7ZgFvp3TqjrXoLq1p3GWPiM3VkYyMHZrNkIzmEVet4E1t6Z28ncrE3p6jq5AxHV+t J8h4amQEeTR8ShIkvATCV9FXvGhLdh1jo6irm10kbEoUp+EbAJASWGS52Gw1wrwLrrV2 ZX0tIVCFInfJyuPivfGJQ62k2if6L1UWzDwtCriIDvVLNm/AuYqJZ3/hcJGMKoHqGFbl IR6voeAvr7hZxhsXa0oLB+cbAaAP/YVK5+KKkkvet8IgBzHj2YTWCa/XFcwBpJBATfl+ pbEj2rB39AdjYrX9kkbxIfkeyINYNSepK0Oud6EgDH2Ahp3SEj7QXyFzvnuWeE6Hsk7H YicQ== X-Gm-Message-State: AOAM533FhlPsx2U/sLZhTZV300TdMffKDDIzlTO/SFHDs0gYLGoOga/Y KP4G8NlTWKnG+OCmLRPWSwA= X-Received: by 2002:a7b:c212:: with SMTP id x18mr7262406wmi.119.1591868435507; Thu, 11 Jun 2020 02:40:35 -0700 (PDT) Received: from localhost (ip-37-188-174-201.eurotel.cz. [37.188.174.201]) by smtp.gmail.com with ESMTPSA id l2sm4040320wru.58.2020.06.11.02.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 02:40:34 -0700 (PDT) Date: Thu, 11 Jun 2020 11:40:33 +0200 From: Michal Hocko To: Johannes Weiner Cc: Andrew Morton , Alex Shi , Joonsoo Kim , Shakeel Butt , Hugh Dickins , "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 19/19] mm: memcontrol: update page->mem_cgroup stability rules Message-ID: <20200611094033.GC20450@dhcp22.suse.cz> References: <20200508183105.225460-1-hannes@cmpxchg.org> <20200508183105.225460-20-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200508183105.225460-20-hannes@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 08-05-20 14:31:06, Johannes Weiner wrote: > The previous patches have simplified the access rules around > page->mem_cgroup somewhat: > > 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(). > > 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. > > Document the new rules. Any of the following will stabilize the > page->mem_cgroup association: > > - the page lock > - LRU isolation > - lock_page_memcg() > - exclusive access to the page > > Signed-off-by: Johannes Weiner > Reviewed-by: Alex Shi > Reviewed-by: Joonsoo Kim Thanks a lot this is a big improvement and simplification. I have gone through the whole series finally. I have followed up where necessary but overall this is really nice! Sorry I couldn't jump in to review in time. -- Michal Hocko SUSE Labs