Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp72168rwb; Wed, 7 Dec 2022 14:38:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf77Y1MGaKrVpRXe4yRJbcFnrg6Ajob6ojKaZvCk+RCMtylxY23asorDx9S4AApxEz0wLJry X-Received: by 2002:a17:90b:3687:b0:219:468e:88ac with SMTP id mj7-20020a17090b368700b00219468e88acmr47677103pjb.105.1670452712148; Wed, 07 Dec 2022 14:38:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670452712; cv=none; d=google.com; s=arc-20160816; b=wmQpyHzb1aksigI9l0EIwVO6MywNK/h1nwDXsbRIq/Fsq1SV9QGl6FZn0/tlz/oujy QQmvuhIzxrf6jmyPn5hV2ddUC23roSre2FC9jFKKsZvpPuxOmxf1HLKcUICFJ3SUweqf z1lTwhJJY+qmnz7LShMfSyga/9+/WHhjYCSB2XODPwUDey5lP3NUYnwuYnWL0754jOPv FI4pEvOQzv3Nlds9urCdfrfF1F52N2dmHs01Q0QHbzPDsxU9TBsiqF+tsdBQ/Zjx6O5E 52o2wFpvB49J/s4V+m6ZND5LuHaGgOb6CZlAlFD0BugWISViV64aBnWLCLeG/jW+2NuU Jzfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6md11XMzi0tM9VfuttVehehretVvYJGzXswfjHRw2Yk=; b=FEfco/5tNIWJ8pVIM1IETnedlffM3ysXzvFIKA8iMASeGdp225tTshTl4+o5f29HMK zomrNgYNZXUYuSQUI5FWvfHsxwW686qwiSY8gR41Z66vu6ZRxd1O+iSNF015g8GmGexH +7491WdZxJcVBfzJQEZPS7+sXyM6a06e8f6rLp3I2wC+ro70zu32xmabguc7A0oyreAs HFgTrsej1CaQvzfmCsPR6I0Qkuc59JrPygqiTrXOularj/HaSLaKaE28TA9QWimbgY+2 prsI/ErQTsaCArS1D1xW12IdEw+irftIotNKFi0Z5M7pg7OOgVYYS6m6xZo5TFbL3oON o9/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FVhyDC1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a056a000c8200b0057572f3edfasi22008879pfv.127.2022.12.07.14.38.22; Wed, 07 Dec 2022 14:38:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FVhyDC1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbiLGWPe (ORCPT + 74 others); Wed, 7 Dec 2022 17:15:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbiLGWPa (ORCPT ); Wed, 7 Dec 2022 17:15:30 -0500 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4F86153D for ; Wed, 7 Dec 2022 14:15:29 -0800 (PST) Received: by mail-yb1-xb2d.google.com with SMTP id g4so4990278ybg.7 for ; Wed, 07 Dec 2022 14:15:29 -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=6md11XMzi0tM9VfuttVehehretVvYJGzXswfjHRw2Yk=; b=FVhyDC1j451hmgMkwi1V7ZI4X8jOVWr/eIXmSC2wvcstj2nqmH63mzvSgwTtApATU7 c5BKCleqCvOmWqkJMjNflr+8QXYBnxcOe+vMskQUHOYE6kLQMtsWp1TscflaWmBvVchW 1+T44q440TMM6kpmml1fH/7sz02N0B0oPTP/arw7d+LG2oYA1h3b83NbFIbbTJASfxrL hvFcOa6aCxls9HxIdBn80Leq+fJS4b/Qu4JUpuIbAuBsk7hlWLhuzXiizfLeCfikD0Vu kPIHF7EbCCpHToNq47vCM2gtuZGqmzjfqNe3Itbh8AzNvl7j1zF04iWA4a0LZgTg/mUY hIwQ== 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=6md11XMzi0tM9VfuttVehehretVvYJGzXswfjHRw2Yk=; b=BGqM3Hzq0KQiweo4MvU2F528HPh7P5EMS/hg/Ii0qrnM+4OnCO95Z/thRG1K8ZGa5R NxEydaCvAni+ei0br8hIyrtnhgAzW4BEhU+19se+H/x5/LBMdU/2+ZL5RPM1wi4VcToc kocfoLJJ78n6MIRmkj4rBDJocB4JaP5edB6HMNgUWnWe7CvnYc5wFqXe+njWv6isH2RS 3r7kuHDrTiMLZDFd2nYQ/rL8VfFtbPsZ65s0y4wxcNzCzbkJSKpz7IU/uLP53qlUE0JU H4pwb70RvjB0ouvwoiZxuYXrTHLe34UCyhzJBX8l2/CkVr/ztio4yu/ERysUx9dH61De qIHg== X-Gm-Message-State: ANoB5pnVvsDHAU3XU+LG4j23Vqaj1HVl4D41ExD5sraRcu9npbOk0xa/ p1AKz2qSGmDkTnL5hjiXt/QjQFk38bcslEgXONazQQ== X-Received: by 2002:a25:38ce:0:b0:6f2:2d94:2404 with SMTP id f197-20020a2538ce000000b006f22d942404mr62740808yba.450.1670451328572; Wed, 07 Dec 2022 14:15:28 -0800 (PST) MIME-Version: 1.0 References: <20221206171340.139790-1-hannes@cmpxchg.org> <20221206171340.139790-4-hannes@cmpxchg.org> <20221207135108.fe1d51f7581f6ff86dbf9bc8@linux-foundation.org> In-Reply-To: <20221207135108.fe1d51f7581f6ff86dbf9bc8@linux-foundation.org> From: Shakeel Butt Date: Wed, 7 Dec 2022 14:15:17 -0800 Message-ID: Subject: Re: [PATCH 3/3] mm: memcontrol: deprecate charge moving To: Andrew Morton Cc: Johannes Weiner , Linus Torvalds , Hugh Dickins , Michal Hocko , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 Wed, Dec 7, 2022 at 1:51 PM Andrew Morton wrote: > > On Tue, 6 Dec 2022 16:03:54 -0800 Shakeel Butt wrote: > > > On Tue, Dec 6, 2022 at 9:14 AM Johannes Weiner wrote: > > > > > > Charge moving mode in cgroup1 allows memory to follow tasks as they > > > migrate between cgroups. This is, and always has been, a questionable > > > thing to do - for several reasons. > > > > > > First, it's expensive. Pages need to be identified, locked and > > > isolated from various MM operations, and reassigned, one by one. > > > > > > Second, it's unreliable. Once pages are charged to a cgroup, there > > > isn't always a clear owner task anymore. Cache isn't moved at all, for > > > example. Mapped memory is moved - but if trylocking or isolating a > > > page fails, it's arbitrarily left behind. Frequent moving between > > > domains may leave a task's memory scattered all over the place. > > > > > > Third, it isn't really needed. Launcher tasks can kick off workload > > > tasks directly in their target cgroup. Using dedicated per-workload > > > groups allows fine-grained policy adjustments - no need to move tasks > > > and their physical pages between control domains. The feature was > > > never forward-ported to cgroup2, and it hasn't been missed. > > > > > > Despite it being a niche usecase, the maintenance overhead of > > > supporting it is enormous. Because pages are moved while they are live > > > and subject to various MM operations, the synchronization rules are > > > complicated. There are lock_page_memcg() in MM and FS code, which > > > non-cgroup people don't understand. In some cases we've been able to > > > shift code and cgroup API calls around such that we can rely on native > > > locking as much as possible. But that's fragile, and sometimes we need > > > to hold MM locks for longer than we otherwise would (pte lock e.g.). > > > > > > Mark the feature deprecated. Hopefully we can remove it soon. > > > > > > Signed-off-by: Johannes Weiner > > > > Acked-by: Shakeel Butt > > > > I would request this patch to be backported to stable kernels as well > > for early warnings to users which update to newer kernels very late. > > Sounds reasonable, but the changelog should have a few words in it > explaining why we're requesting the backport. I guess I can type those > in. Thanks a lot. > > We're at -rc8 and I'm not planning on merging these up until after > 6.2-rc1 is out. Please feel free to argue with me on that score. No, I totally agree with you. There is no such urgency in merging these and a couple of weeks delay is totally fine.