Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2476744rdb; Thu, 21 Sep 2023 22:34:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/YU2iopCf30hkUG47BvZFBJ5FdtEPa4DneJ6RIiYY+nreVNxyI7RU3s+7wR7hLDv7KlzV X-Received: by 2002:a9d:6d99:0:b0:6bd:c74e:f222 with SMTP id x25-20020a9d6d99000000b006bdc74ef222mr7963809otp.34.1695360846967; Thu, 21 Sep 2023 22:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695360846; cv=none; d=google.com; s=arc-20160816; b=hQG6wXQdAHPBLUXfhJHrsWyEY1wn7SrbTZGCCdZCpo6LpLDzqXCMD91ecVER3I3WCC i8A/ncd9iOigTvI8hB/nXqSH0ZBuAwp0UU8aejQcILl+xDESE6HmR8lE2NQBnKnChwtz YvU/I3E80V526n9PqJvGSuyI20uhujmnrRpO4qaiHPyv5rinlykTaFhTsZFYWgZhMEpt pV3PH2Xug9TN28UhGv9lssXK6qIY3p+wPO18ehJKVIADI4ae6SNE1JrTcJXOE/W/zvu4 tgGgjWlf33iTE+52Bxa3tJAOl1XgiJPUxyrsCmx5o27TLA0PpFpUd5Nz76xFJjUvG6CQ 84OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=F9fNT393+ZwmVQgjbtj+WOmx+WURCS26K1KA4ErkEyw=; fh=OD+En00ZpISzDwkWN3URDywNyrUks6oiJLa2I0hfgJQ=; b=bYUCB245KaEVF7vayve/PK8mBTZmUhWq1Q8xE3uWUe6ZYhbw5SGhgHosW3zC4sisi+ GasZGJIhCVz5i1imv3DLjsL4pOUIM67205YCegjWmfjMVp53tYIMh7i4lsNSSpNsMtf9 OLSfUJxVzz/3/O87DYxVy1eYskkJ/+iH2xY+pVBfNP93LwxryYA322INrt5OnixfbqfN 0vfykDHzi4Y5bJItP4QRazE9OKR1ID8R0MrVcTGQFkL5CXR26bScaPuTgI+loXHKbAPU /UvWa+SaBF1xww7/rlBoENSVlK6vHPz95Zi88Xy9wJWcQmLBHje/FXqlP1Xas9OCqEpu wgiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mqcnorfw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d19-20020a637353000000b00577f80ddb2esi2923164pgn.705.2023.09.21.22.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 22:34:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mqcnorfw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9D69982F927A; Thu, 21 Sep 2023 13:28:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232002AbjIUU2a (ORCPT + 99 others); Thu, 21 Sep 2023 16:28:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231921AbjIUU2K (ORCPT ); Thu, 21 Sep 2023 16:28:10 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5C805AE0F; Thu, 21 Sep 2023 12:50:16 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 09DBE1F37C; Thu, 21 Sep 2023 19:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1695325815; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F9fNT393+ZwmVQgjbtj+WOmx+WURCS26K1KA4ErkEyw=; b=mqcnorfwtHQ0g5Unuh4IiRrgaXgqTarwt+Enc/GQ7uXAOuTk0wPklV0ATRXsu7vc4ioTIQ JKrO736zI5g7fWJyxINphvPj1Gfy3XHxQYA54fhbRRAq6WoEwDzVPg22wkc9x226AYVzov 2cf+NVbpnmo8qJp3WLg+1HlgL9tO+Io= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D8E48134B0; Thu, 21 Sep 2023 19:50:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fXiKMnaeDGW5eQAAMHmgww (envelope-from ); Thu, 21 Sep 2023 19:50:14 +0000 Date: Thu, 21 Sep 2023 21:50:14 +0200 From: Michal Hocko To: Shakeel Butt Cc: Jeremi Piotrowski , Johannes Weiner , Roman Gushchin , Muchun Song , Greg Kroah-Hartman , stable@vger.kernel.org, patches@lists.linux.dev, Tejun Heo , Andrew Morton , linux-kernel@vger.kernel.org, regressions@lists.linux.dev, mathieu.tortuyaux@gmail.com Subject: Re: [REGRESSION] Re: [PATCH 6.1 033/219] memcg: drop kmem.limit_in_bytes Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:28:32 -0700 (PDT) On Thu 21-09-23 10:25:11, Shakeel Butt wrote: > On Thu, Sep 21, 2023 at 4:21 AM Michal Hocko wrote: [...] > With one request below: > > Acked-by: Shakeel Butt Thanks. > > @@ -3107,6 +3108,10 @@ static int obj_cgroup_charge_pages(struct obj_cgroup *objcg, gfp_t gfp, > > goto out; > > > > memcg_account_kmem(memcg, nr_pages); > > + > > + /* There is no way to set up kmem hard limit so this operation cannot fail */ > > + if (!cgroup_subsys_on_dfl(memory_cgrp_subsys)) > > + WARN_ON(!page_counter_try_charge(&memcg->kmem, nr_pages, &counter)); > > WARN_ON_ONCE() please. Sure. This shouldn't really trigger, but it is true that if something unexpected happens then it is likly to flood the log so _ONCE is safer. I will wait for others to comment before I send the official patch. To be completely honest I am not super happy about this way of handling stuff, but considering the level of brokenness this seems like the safest option. Especially when nobody really want to use the kernel memory hard limit AFAIU. -- Michal Hocko SUSE Labs