From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Down Subject: Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling Date: Thu, 28 May 2020 20:48:31 +0100 Message-ID: <20200528194831.GA2017@chrisdown.name> References: <20200520143712.GA749486@chrisdown.name> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2+YFw/wWl/gn1xFnRRoYscp8dj86Zd6xiRRZw5MlcAI=; b=tqHUV/QEgE202z+GHgPg+fGlRS0xZIz4uyNfmy01XYON7v71D5ZVVMVzwMsmXRUNCI +wNnZXjkMRgh04H+0uTAJCwfBZkoEkVZ2TXn4uuWhvn/5WhRwgj7zAmDEeqDyjIBwvFQ 0yUVIbbFUXGJfXQzBRIqhjggve4tOXbOWWNl4= Content-Disposition: inline In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit To: Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Tejun Heo , Michal Hocko , Linux MM , Cgroups , LKML , Kernel Team Shakeel Butt writes: >What was the initial reason to have different behavior in the first place? This differing behaviour is simply a mistake, it was never intended to be this deviate from what happens elsewhere. To that extent this patch is as much a bug fix as it is an improvement. >> static void high_work_func(struct work_struct *work) >> @@ -2378,16 +2384,20 @@ void mem_cgroup_handle_over_high(void) >> { >> unsigned long penalty_jiffies; >> unsigned long pflags; >> + unsigned long nr_reclaimed; >> unsigned int nr_pages = current->memcg_nr_pages_over_high; > >Is there any benefit to keep current->memcg_nr_pages_over_high after >this change? Why not just use SWAP_CLUSTER_MAX? I don't feel strongly either way, but current->memcg_nr_pages_over_high can be very large for large allocations. That said, maybe we should just reclaim `max(SWAP_CLUSTER_MAX, current - high)` for each loop? I agree that with this design it looks like perhaps we don't need it any more. Johannes, what do you think?