Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2440636rdd; Fri, 12 Jan 2024 09:24:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IENH+nT78PLQpf7MjaTV3t48VhOrNVTcMEAz1CO88hSy8pCu9fA5tCfeoXBNGoLFrH7+aOC X-Received: by 2002:a05:6214:1bcf:b0:681:3775:ed4b with SMTP id m15-20020a0562141bcf00b006813775ed4bmr1465053qvc.29.1705080239984; Fri, 12 Jan 2024 09:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705080239; cv=none; d=google.com; s=arc-20160816; b=G7axBNdOMldM/KZ4QbdN5DdNPaL9EoDOQAEqoTBLznZ5U1mk2UvVL0AM9ET021cDmh xFCeIHjVrIeNuxPwz2UB71SyENpJKdKqX1JgDHFiIiUabkhVe+ZgAxPk1wMXTw1uqeK0 3lN5OhF79O5np4rB9sJH5x9yIdpp12IrQL1Jmk2cfjZWVp5OngkxhH6PepzYoDBKGWDb 7UEIrd9DBQR/7VxNFovZSnttL9YxvPm5ZUxJwILBhCCXhIcOO0e58KvchrBjqhRHQnxo SYpPAlWa/azQ0MNwoZjeydsr/vc6kcp+7Z2rW3LG8DS7P2mHHGexlz0L0lwO/GszPepA UP6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=xHxzNkl3+lg5RxMKF+f20439C0qvkhGvp+j1/UrE0ss=; fh=2ccel1xtjEf3EPkc8VidIhXR0Qtd1nrbx/CAeFsAkxQ=; b=CKB2e7JlIwo6sjjXXbal77sXcNCJBalH8Kp0AvSr0x/nsoggjS3DspaElx6ozsra7r G2BJmNuyvl8A7CDXQC23j0CnyoFo4b1VbOrJXDVEpBjut4DiI5y/btaZBcoHfBeL0BRA xa0ray0fgRuNvKrNDZtoIHLoZMkAsATtsKQ3iGZ/EhSEgphMXtivDCprjdeeM8fnkY2T n95egKKwQoBNA8tHOFRAk7U1u25A9/wPq+dNW8m7scB4H8qSOI5HaD6jcd+drqi6bgTC rmOdJTgyzYhhQHFiNDSgtPe+wryNS2ODyh2lWniqJvndGg5WOOy21uRpxmbPSQiJnHWF 9F0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=coh+Fnu1; dkim=pass header.i=@suse.com header.s=susede1 header.b=coh+Fnu1; spf=pass (google.com: domain of linux-kernel+bounces-24917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t6-20020a0cc446000000b006805f51071dsi3189910qvi.40.2024.01.12.09.23.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 09:23:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=coh+Fnu1; dkim=pass header.i=@suse.com header.s=susede1 header.b=coh+Fnu1; spf=pass (google.com: domain of linux-kernel+bounces-24917-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24917-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BACFA1C2238A for ; Fri, 12 Jan 2024 17:23:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A94DD17540; Fri, 12 Jan 2024 17:23:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="coh+Fnu1"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="coh+Fnu1" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E45F22618; Fri, 12 Jan 2024 17:23:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 145DF1F396; Fri, 12 Jan 2024 17:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1705080226; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xHxzNkl3+lg5RxMKF+f20439C0qvkhGvp+j1/UrE0ss=; b=coh+Fnu1UJz13gGiunWRvCcSzWJD2fwZrkHJ5sUDzW6vhjdNim8KWDD2ba23fDxBMIh1lB Jp5SehF/gfoh3YoHmxoQ9FtbDGLOeqgz3mVfxnA2nOI4th84z5IY4S80dEy8XvzzBee4jM BbATxr1ambWoEyMxadVor+ufkHahK20= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1705080226; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xHxzNkl3+lg5RxMKF+f20439C0qvkhGvp+j1/UrE0ss=; b=coh+Fnu1UJz13gGiunWRvCcSzWJD2fwZrkHJ5sUDzW6vhjdNim8KWDD2ba23fDxBMIh1lB Jp5SehF/gfoh3YoHmxoQ9FtbDGLOeqgz3mVfxnA2nOI4th84z5IY4S80dEy8XvzzBee4jM BbATxr1ambWoEyMxadVor+ufkHahK20= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EAE3E136A4; Fri, 12 Jan 2024 17:23:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id uTxdNqF1oWW+OAAAD6G6ig (envelope-from ); Fri, 12 Jan 2024 17:23:45 +0000 Date: Fri, 12 Jan 2024 18:23:45 +0100 From: Michal Hocko To: Roman Gushchin Cc: Johannes Weiner , Andrew Morton , Shakeel Butt , Muchun Song , Tejun Heo , Dan Schatzberg , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: memcontrol: don't throttle dying tasks on memory.high Message-ID: References: <20240111132902.389862-1-hannes@cmpxchg.org> <20240111192807.GA424308@cmpxchg.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Level: X-Spamd-Bar: / Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=coh+Fnu1 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [0.36 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.com:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[10]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.13)[67.72%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[cmpxchg.org,linux-foundation.org,google.com,linux.dev,kernel.org,gmail.com,vger.kernel.org,kvack.org]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Score: 0.36 X-Rspamd-Queue-Id: 145DF1F396 X-Spam-Flag: NO On Fri 12-01-24 09:10:33, Roman Gushchin wrote: > On Fri, Jan 12, 2024 at 06:06:39PM +0100, Michal Hocko wrote: > > On Thu 11-01-24 14:28:07, Johannes Weiner wrote: > > [...] > > > @@ -2867,11 +2882,17 @@ static int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask, > > > } > > > } while ((memcg = parent_mem_cgroup(memcg))); > > > > > > + /* > > > + * Reclaim is set up above to be called from the userland > > > + * return path. But also attempt synchronous reclaim to avoid > > > + * excessive overrun while the task is still inside the > > > + * kernel. If this is successful, the return path will see it > > > + * when it rechecks the overage and simply bail out. > > > + */ > > > if (current->memcg_nr_pages_over_high > MEMCG_CHARGE_BATCH && > > > !(current->flags & PF_MEMALLOC) && > > > - gfpflags_allow_blocking(gfp_mask)) { > > > + gfpflags_allow_blocking(gfp_mask)) > > > mem_cgroup_handle_over_high(gfp_mask); > > > > Have you lost the check for the dying task here? > > It was moved into mem_cgroup_handle_over_high()'s body. Ohh, right. Somehow overlooked that even when I was staring at that path. Acked-by: Michal Hocko Thanks! -- Michal Hocko SUSE Labs