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 X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E209C433E0 for ; Thu, 28 May 2020 19:48:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E8CED207BC for ; Thu, 28 May 2020 19:48:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.b="tqHUV/QE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8CED207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7E6278001A; Thu, 28 May 2020 15:48:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 796DD80010; Thu, 28 May 2020 15:48:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65D968001A; Thu, 28 May 2020 15:48:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 4434F80010 for ; Thu, 28 May 2020 15:48:35 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F1B62181AEF1A for ; Thu, 28 May 2020 19:48:34 +0000 (UTC) X-FDA: 76867164948.15.drink51_2dbb4634d061a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id D0F231814B0CA for ; Thu, 28 May 2020 19:48:34 +0000 (UTC) X-HE-Tag: drink51_2dbb4634d061a X-Filterd-Recvd-Size: 4160 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 May 2020 19:48:34 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id j10so485971wrw.8 for ; Thu, 28 May 2020 12:48:33 -0700 (PDT) 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= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2+YFw/wWl/gn1xFnRRoYscp8dj86Zd6xiRRZw5MlcAI=; b=VPSLz0lBO37hiikLJfL36YScIHv+gdkAGcvKhFTRFR/M/EBAG+2u8aFTxivSaMUUt/ TaM+iUpPKG35Fssdu044nkFtGaq7elPzFTuYBEAspfNW12cn/WMhUgIiWYUK90GxsP0Z lh3dd5UElYGJP1heny0tNEV2rU1RFdF5qS1BFgFJnWXlNygfIWIHXCACpW6GQ5L4ehFU E+mzDd5Xv+8jDlgHGvy+2fMrb0BzCoAfSjlhx9gJEnQC3S6yKsCerHBBp/A2Lgx//vKe gAJFeHb8KdgsfJoeFyArp/at7veRCrnc3FHv0p2RKQfZfktKs3S79cAEp9tBvC0LFK/9 ErzQ== X-Gm-Message-State: AOAM530+Q8Ovc5Ux6H/F+jDKWKPf/zOd5nryd1lDMPH9mtACC5zCSQW5 P3PVp+sOhk3A8Dhm1x4aYRsUoA== X-Google-Smtp-Source: ABdhPJwbCOVC5ocul7Wfmi+oZbpyKXkSi2NcpQnG2t0XZ9mSJ4faNZIYvWaeTEZWugouk/oUeG8yXQ== X-Received: by 2002:adf:a283:: with SMTP id s3mr4706803wra.147.1590695312615; Thu, 28 May 2020 12:48:32 -0700 (PDT) Received: from localhost ([2a01:4b00:8432:8a00:56e1:adff:fe3f:49ed]) by smtp.gmail.com with ESMTPSA id l204sm8225768wmf.19.2020.05.28.12.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 12:48:32 -0700 (PDT) Date: Thu, 28 May 2020 20:48:31 +0100 From: Chris Down To: Shakeel Butt Cc: Andrew Morton , Johannes Weiner , Tejun Heo , Michal Hocko , Linux MM , Cgroups , LKML , Kernel Team Subject: Re: [PATCH] mm, memcg: reclaim more aggressively before high allocator throttling Message-ID: <20200528194831.GA2017@chrisdown.name> References: <20200520143712.GA749486@chrisdown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.2 (2020-05-25) X-Rspamd-Queue-Id: D0F231814B0CA X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?