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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7582BE7D0A2 for ; Thu, 21 Sep 2023 20:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231694AbjIUU2c (ORCPT ); Thu, 21 Sep 2023 16:28:32 -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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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