Received: by 10.213.65.68 with SMTP id h4csp791909imn; Tue, 20 Mar 2018 15:46:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELuy1Z9CG5XT7+yP/u9dzORHsx81JakjMvjM3pGSGu8D5u31KllPhOQE55x1+T3QtG1y3Su+ X-Received: by 10.99.172.10 with SMTP id v10mr13309809pge.341.1521586019268; Tue, 20 Mar 2018 15:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521586019; cv=none; d=google.com; s=arc-20160816; b=VVlfYwo87qvGfr5bjV3JEZGOFVeTJ9LfpNKlWAIRdQ7xzAHIz7fN9RF4DlzD/8bPoK OTYMic35WDTrpP9voGPeXSGMiHTGqPMFymlccqZk86MMJo9AsCvvOvFMbYSPwPX/yyBe H0TeE0smsyRVrxyAJElS7PX8ouCsVvNNtSZ+KWumkwf796yh6ynIrOKqW+36J/PwqZpw v4WWKXcFA0+msIpcMO+mOdG52KkN3gx08+NmczexheUGEol1W3T+WXGQCBot7CjeLPOW QNam0KQQGkPeMQIocNIbXUMKeT57ycG86ekWYgF2+YJRpPgG5O5LDyKJXC2spO5MGsKJ VZ4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=NPikiFOK6hIbw8sv4Z0hFwFFiEM+tdmFNMryWQvorQ4=; b=zPPqPnsi4b7mfA5PmqAipWlEFiF7+61KCABkDaeEj4uow9Yz8qXzkvCmVwz8Ny3RcL 3fqNxSFOkCu/1d2Yhj3LHPo8lq4wlI2OPjq8CpmVWRRtW0tvu2fY8Y0kuG1p009roBEJ pI/u3jy6fnfa62NWJPl7GvCrDjlksa2ElW0hPBV7Fy+Zcp0IhZOiHSyaWxeBJoITM2G1 IQ5Ex1yNrYbtxE4/9sj595BX9+eAgigvBQHKAMBqLd6Sly3IWNHnx/fWTfxEnPCnsd4/ LvUQynynElMpJ+AmxZbKBNr18sfTsAo0zlb8HttwmmzRHlitfNHVVzI7HCW+rm2SuoIO SbQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FpU6InHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si2478602plb.349.2018.03.20.15.46.43; Tue, 20 Mar 2018 15:46:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FpU6InHv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751515AbeCTWpc (ORCPT + 99 others); Tue, 20 Mar 2018 18:45:32 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44903 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbeCTWp3 (ORCPT ); Tue, 20 Mar 2018 18:45:29 -0400 Received: by mail-pl0-f67.google.com with SMTP id 9-v6so1927209ple.11 for ; Tue, 20 Mar 2018 15:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=NPikiFOK6hIbw8sv4Z0hFwFFiEM+tdmFNMryWQvorQ4=; b=FpU6InHvW2aIe+EtX5hwDHfbheX7JKOx8zxLZ/8HgqC6xWYiOol+CgXcKpttGghqfr +bP4/kSt9poe1G7V8VdvSIk/tEjn/bmNBcVDQ5wxgxoPLFi4a3tPehaJ8R/TEIGLW/sq FvNtaQibnekhMHENcQkZbP2GDzfa7Tau2StSEXncUn2yOqmRJy/r6brkGfSx4dbL48Gk YoFjAMZSJLdEiPKHvIRO4EZD7C7zYYxszsnTmFp3ghX2iDm/6fdMYHdtq1ElHw0sWCrY j1wCivRH6MLHxrXvr8zskte32yDzP+ELpo6sqF9+F2NTZbSaobFx9ZMoR++onjMrRTpP xbjg== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=NPikiFOK6hIbw8sv4Z0hFwFFiEM+tdmFNMryWQvorQ4=; b=d8zY/IPLa2QoXGKP72oVfLfsjly/lSlczcIYR2WJ1uDx+YO56MYRrCGBPP+lYYiCLD 622dRYqY1AY0WduoQaxicjJZMgXc5oFECfw5YvUPiBvw538DAAANNsHhgV/3Gw1ePsxe NB5CjlVFWB9PPkY9JR3yHAINzeRb4h2078bj+U2qsdnjlQizcDOl+VQLWKoihYkrj/bI GlT6AGEKfkAc+ckUH42UU3x9+u9XCdSMiC6u3vS0S8jhsCTmRbeAT9HLvadxOiFmBlfh pP/wuY04Wl3t8/2pEuNutqtid1qgtN3KJtgVg3Dx352g8jZttzzpF5DCSgaOBqkr+MF+ nxgw== X-Gm-Message-State: AElRT7HqgmIVzD7YJtJdKhd2CILsGQ6Kanz2BIMShJUjq4aBIBAnTLmU ENDuAdBDb/qO5WV5WFDJjBqphQ== X-Received: by 2002:a17:902:8214:: with SMTP id x20-v6mr18507349pln.182.1521585928629; Tue, 20 Mar 2018 15:45:28 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id b21sm5296706pfn.145.2018.03.20.15.45.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 15:45:27 -0700 (PDT) Date: Tue, 20 Mar 2018 15:45:27 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrey Ryabinin cc: Michal Hocko , "Li,Rongqing" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "cgroups@vger.kernel.org" , "hannes@cmpxchg.org" Subject: =?UTF-8?Q?Re=3A_=E7=AD=94=E5=A4=8D=3A_=E7=AD=94=E5=A4=8D=3A_=5BPATCH=5D_mm=2Fmemcontrol=2Ec=3A_speed_up_to_force_empty_a_memory_cgroup?= In-Reply-To: Message-ID: References: <1521448170-19482-1-git-send-email-lirongqing@baidu.com> <20180319085355.GQ23100@dhcp22.suse.cz> <2AD939572F25A448A3AE3CAEA61328C23745764B@BC-MAIL-M28.internal.baidu.com> <20180319103756.GV23100@dhcp22.suse.cz> <2AD939572F25A448A3AE3CAEA61328C2374589DC@BC-MAIL-M28.internal.baidu.com> <20180320083950.GD23100@dhcp22.suse.cz> <56508bd0-e8d7-55fd-5109-c8dacf26b13e@virtuozzo.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Mar 2018, Andrey Ryabinin wrote: > > Is SWAP_CLUSTER_MAX the best answer if I'm lowering the limit by 1GB? > > > > Absolutely not. I completely on your side here. > I've tried to fix this recently - http://lkml.kernel.org/r/20180119132544.19569-2-aryabinin@virtuozzo.com > I guess that Andrew decided to not take my patch, because Michal wasn't > happy about it (see mail archives if you want more details). > I unfortunately didn't see this patch in January, it seems very similar to what I was suggesting in this thread. You do a page_counter_read() directly in mem_cgroup_resize_limit() where my suggestion was to have page_counter_limit() return the difference, but there's nothing significantly different about what you proposed and what I suggested. Perhaps the patch would be better off as a compromise between what you, I, and Li RongQing have proposed/suggested: have page_counter_limit() return the difference, and clamp it to some value proportional to the new limit.