Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2432897rdd; Fri, 12 Jan 2024 09:11:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGm2CjixahtE6HcfRwVzen135WwFmh2y9RKyrp0hVnXbwSehVOzG23d9ImiuRpfte0BKoWJ X-Received: by 2002:a05:6602:589:b0:7bb:6d45:d94a with SMTP id v9-20020a056602058900b007bb6d45d94amr1934125iox.22.1705079519637; Fri, 12 Jan 2024 09:11:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705079519; cv=none; d=google.com; s=arc-20160816; b=ubvq0AWyxDJME7D0b8g0DXRbQ5VX/aBvzo81WDsC68HWToeKBO7kBmbCHstFS4ZJzs j69BmUJjVpRwSs5pctL1D2z3uJvg93FMm+GHkCwWuL+k/9WnZjjZIGfZXWf47sWtDrb8 kL7IOSze4dUZs8+eQey827gJiTx3Shy5fst+6G2149tJRJ6dJxrPcldHM2abBsOVmPkG CczPbRT3kJolHVjtDo/oYbhMh8gEsUdmPfKtx59uXslmzDXTjExQDzkOaezRFPddhbmL acS9s3RSutZZ7ESwMIzpoDvaiZdCybYhpsd2nWKtpRQS+xWqQI/iZ0TtC8UarU92Sas2 9F+g== 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:dkim-signature:date; bh=McdqJF13JJY95fe2wVB3NPXE39DtpV52lmmGUDjCt/8=; fh=YkoCuz78RNmotCwGEBAlqtvzItlWoSnqClSgF8PUk/M=; b=EVQIuCwKD1oEkOndjlt6O+zRy1FK+/x9exk7BOuFdxfFwCvYrvY/F9odZjR1n++GgE yN/ViQbDsjj18lv7EDQA7fujwd5snLUgLABhvykZkgZLsfuHsFOzX/7RiW57t4BLLN8x pMY/+jYAeLlKH6AlL9SgqurXuvCr33hZDBzFAccLT3NNp8U57UxveIuUvd3I/NaSUB1K hPbP6gE6JlpX8FMAxxK8KsNg7HwfJpUY89WZ86xS83BBdSScxeqT0CTq35ktOfYcAhu4 z3RcHac+HHPXp+mTiZjkFOcjiZmcu+4U74nb7qRAlySTRtJE4q9MutkmOecS+VhIdiA6 13JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Azs5GhsS; spf=pass (google.com: domain of linux-kernel+bounces-24897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x1-20020a636301000000b005cd813c23besi3783248pgb.415.2024.01.12.09.11.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 09:11:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Azs5GhsS; spf=pass (google.com: domain of linux-kernel+bounces-24897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AD9FBB2229A for ; Fri, 12 Jan 2024 17:11:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 895E21AAC2; Fri, 12 Jan 2024 17:10:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Azs5GhsS" Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CDCC1AABB for ; Fri, 12 Jan 2024 17:10:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Fri, 12 Jan 2024 09:10:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1705079451; h=from:from:reply-to:subject:subject: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=McdqJF13JJY95fe2wVB3NPXE39DtpV52lmmGUDjCt/8=; b=Azs5GhsSQc0JX1eVWdKhQOMnykKCEd0TUAy5wBRqscrGBpynqnH9NrztgOh9i4qcO4ySG5 JCfXydZMdgx15mjGt63BsD9HBndIph9DkxlorF1HV18ImX9uxbRs2qO3pyfDiSz8yEtYsx 2tt8hW1AI1BDy8SQGP2BvUcqYYj+by0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Michal Hocko 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-Migadu-Flow: FLOW_OUT 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.