Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp697601ybm; Thu, 28 May 2020 12:54:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIbwxYZjgAOcgZFUinn6tgLowOedVtvw/61UhLFxHBcl3KuXkFeUUcO4JOaYC9Hy+3lr+h X-Received: by 2002:a17:906:5e08:: with SMTP id n8mr4699473eju.132.1590695647163; Thu, 28 May 2020 12:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590695647; cv=none; d=google.com; s=arc-20160816; b=GuF35vxoB4NzNDh9O8SZtj3/VRgi0r7PJ1Y8k0ZlKZXeO4EwhDTHZqzCHWbjTef8OL uAAw4LmufMEAPKUXtZv1a0B2oSZHrIebi9+NpbBwXlWlvaKuAuTZ8qbU9qI56QhZetY7 0XqbbVWJ9HWivSi2p1NrHXVPl4usuaOEgMVUQdDAFdFClE/PwfD4Kn6dOnV0VEExlxp4 xxh+O6fEOKkd2Z1rRVzrEtdfPvbuzaxskmxbQQx5jsDGdSwo29Y7+AG3klDbzTUjuWjL emzBVcz9Ge0yxD+eIYKgFXN1WGRBWiB1lobBRfBGJOzkfrSfp/+AMiMnCpVLIE9sDZb5 /Sxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2+YFw/wWl/gn1xFnRRoYscp8dj86Zd6xiRRZw5MlcAI=; b=oSaxPIle4cHKUlRxHjdaJbbLDJWYifxfIIZTGYv7IlGEcMCs5YhPdafj9Ljsd0gzGH B/bb0Xg5r0H3hHWhRLTY/rDqi+YAOS+V5dTT/DSrGU+pnBQjabtRG9TBUQ0xlIjXH0Fr BDfr1mv3a1NK0R8jt86pg3x0mk783jiO7UVkwsX4gLslQf/qhFxDWb1SXCVnRazYa0xc OteL3km23UZ4pvI94JNjDuYFnj8BfjgZksqvwAr8BzlCwC0Z1D5oqqGUk415jXxEp1jV FyH1SYrPQu2e7vhwPA14jVpwaVgY0iW5bjAF4vLYgA1b3uhdS5BNK4YwO52h9DudJA14 iEkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b="tqHUV/QE"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt20si5764555ejc.24.2020.05.28.12.53.43; Thu, 28 May 2020 12:54:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b="tqHUV/QE"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406778AbgE1Tsh (ORCPT + 99 others); Thu, 28 May 2020 15:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406704AbgE1Tse (ORCPT ); Thu, 28 May 2020 15:48:34 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2E30C08C5C6 for ; Thu, 28 May 2020 12:48:33 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id l10so467669wrr.10 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=AncZZmvPRD6ReOBH5fOSSOEP/bPq0cDXlyn2Rn/ZqSvSMFevGD8ndxpw1zxzdhCWwx d8v0+simuk34OtTAEMxECKe27yv71g/kA3R940JtRXynkQWatii8LCKtAkBTkNl2sMSO y6Aog69vAiVB7dZZpMLQUAph3QtKeYfdpOhnuVAu4eLa7gIAbwqZI6TIbTCGLdW2HTSv k7Vei0zvPJQNfju9LJJKG+PK/o+qzNAGvmoLoIXi9UFuIfHfFx+Z0x6ZyqLk8J125f+M ohCj+ai5lOP/t3882DMf4UaL7QFzH3uB0ZpdolsEwZQ8OZ9VB9+y7Lgblf0jKMweVwGl uIsA== X-Gm-Message-State: AOAM531ZC5KYPHTNVJaegU6qEbCPz2qeRVUIZ9PAqDRiuAIUg9epmQuf UYivvW/za9m/jkp8PHzgmZE7OA== 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?