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 104F3C63705 for ; Wed, 7 Dec 2022 22:15:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 834968E0003; Wed, 7 Dec 2022 17:15:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BDBA8E0001; Wed, 7 Dec 2022 17:15:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65F138E0003; Wed, 7 Dec 2022 17:15:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4CC6C8E0001 for ; Wed, 7 Dec 2022 17:15:31 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1A502AB1FD for ; Wed, 7 Dec 2022 22:15:31 +0000 (UTC) X-FDA: 80216917662.23.2B1BF8C Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by imf25.hostedemail.com (Postfix) with ESMTP id 9FFC1A0017 for ; Wed, 7 Dec 2022 22:15:29 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=FVhyDC1j; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of shakeelb@google.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=shakeelb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670451329; 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=6md11XMzi0tM9VfuttVehehretVvYJGzXswfjHRw2Yk=; b=dyNhLEo0oQkgTEx2ppY8nyCkY2LEFIuBzt/lhRIrSkvu54VxFS8m0f1mhgxtr9SASDufe9 GL9pVZWrPCD339S+SWkLvM0dgE7vxkFJvt6U4hADChTB1u2K+WP1kvBwS/mJd9pm/2GY0x xE5gcz+Egy1o6zjXyh1tSd2hzRgWZIE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=FVhyDC1j; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf25.hostedemail.com: domain of shakeelb@google.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=shakeelb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670451329; a=rsa-sha256; cv=none; b=BrMkeEV5bxpzRHzEazhgyymSiFEJlV3qJpu7PT8VMTZP4XSc2rfHpqP6A7dH1LDvnyhrvb ly4poRBkCTEOUhbGShCpO+ZqGUFTlJTzKw/Y32iInAqKqZ/xWJDxcNtJeUx9fQel7OFk25 JckjZKKueRmEpfGl1n+2nydk1bo3+zo= Received: by mail-yb1-f180.google.com with SMTP id d131so21167498ybh.4 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=IsEDvEk2uV8SmBlXAcODn73ue/lJbcas2nbZ01Slw5JBcgv22Nvx3JLTZ4sghjxm2M Mt2m/Mr3UYkCzT5yhG81dovZV+7ceX0ssGugQRfQ4xjKfKJPq2lDLNA2cyY32utim7a9 0Fbz2Zn9uJTnys/kbIZboYMYZgMqsCxwBcV8+1OiIuG8f92WedpzJ4vYTKr4GXKkSHRN TmtBnimnScip0/qtFQAWCN+3mkDOSshRp7E6mMn4kr1ZwSizQFBa3+BDCNVaxiaNv93f JfVUci3cAaH5FQEZ8D/ojVQGbLso29C9xAvoWdT1ayqENblSYKOXO/ucHB4YKMUYY1dR /oSA== X-Gm-Message-State: ANoB5pnF3BMy8/SseBqncIcsvpTcgmpVa2a6zHjq48Upnl91XsYfp2Si OpvkrR0PLWBbRQ1v3wF9XC/V+30iCCHwNEUbOP7mvQ== X-Google-Smtp-Source: AA0mqf7TLp05aDxpxhqV9kkhq645nCfRl6FYotHcE+YUw02Xl0zYpu/u76VpGq2O89cFFgpqbpUDHfwV18Nu9M3LsA4= 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-Rspamd-Queue-Id: 9FFC1A0017 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: qq9xati3jmd8nnr4tq9x18rnry95cus4 X-HE-Tag: 1670451329-97582 X-HE-Meta: U2FsdGVkX1/2e2wR1laNuq1V0+W70IqSOxsQA4iVtgBqk9vDy/8dSCwhDCUJSwWAfuQjdDaOrbdZmyNKRCZuQhKn9jEKxrFpyFSsxpsqwVYThg7Lk55RlrclPg4SSPjtvUIY03CDJWIZiRgQ+dBLi8YY01jJ09t6nSyvzQQ6c8A3ONE2OUFxLLYvLinLgVyHg92KU4Kd8xf8jKyR0czpVD2pwfHgyme5MFdo/+E3sHXjRn0JhQ9n7BaPSNMAF7oDqPPt4u36zldPrvBgBtyZ/DQNd9+5YtxOt674oBnCZk8Mi3AtagytW96ktQiCzkTkaAMoCnBi2gR0fwZ/ILPXMZ1YQPFVO+r8LYVdRSi/qmHJoNPeoT5lGH3kZjeYBe1U1f+MUqautpy/USj0s/A+S9wR+cfA4lLSBQd7zM4SGd7+v1BVsNjaEVJkeKzbmR0UpSSc/n3hAwPanxOcvz6eqy+aU5Y51aoQq/mTU0O6BWAoqe457ISOLm2WACMIknUY/2SrKxvNsNs9A+w9xZ73Qgmn9BVnBEoZ+A9VmicMq9FD7Z6eJaawubRhobdgN5MsuxG9IHnnGS8wmeof7vPKRMhwpXrOpNfiLkg9hcqacjG3xXLJEw68DySMQsjQDbvHrwl+llh487v1MmdFLP/A63hgSNzYi/UFdWDN8jRLPp7bJD0pIwuzDsYyYhrTvu3uwRKpkhaazb6boc2Hzyj3vJBOCY/B1hNQTKawvmf93kLW/2hxJpc0aFsjjRZKPO3PgJGq68rF67ilm/rV6MDCw6jd8l0tZ4mx+BXV6XpyDiceTF4cbYVKsdqGaFiDv+5HdX5kzC5KmGW2WfGg1UobrA+tBc/J7BAW849/TpkPFj4MIFtFNqz2ZNEtag9+lf8SrwsqcMMeg0BSOAVJF71M3M8NKmoSxKbVNotNCJHzycNfP2qoyJfKS8bSwgbE1ixKM7h0NbRzFXzy/Eognjk s1dDPmpV oe3EkHgXxzCm8sIk= 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 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.