From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 41B911AABE 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Azs5GhsS" 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: cgroups@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.