Received: by 10.213.65.68 with SMTP id h4csp743882imn; Fri, 6 Apr 2018 08:10:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+gN29LY1wQkFVR4PVtSuSKBwbrxmfpScRMFFR8HZPyve7Pmqg7S88Avbe6mU9RgUz05ISj X-Received: by 2002:a17:902:a508:: with SMTP id s8-v6mr28316155plq.216.1523027437290; Fri, 06 Apr 2018 08:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523027437; cv=none; d=google.com; s=arc-20160816; b=fh4VaM6xtt873LS4Mv1G3S9Qr0Xkf5Z0PJgU9Pl3B0db78wKvPKSw1GaipLh0oIA1f 1mruBRKRuK4++SFbitQKjbLoUsbadUj6qhkjUBlB+dLlt3PrG1L7KgffGxOnNEZd5QzW jt/g1tq+eAyyCY/lxElRRzRvPN2DNAhA7tkOkSdWjk7nTRarkSEymrCoK9v4WWfyU5pa DicR90e0Uaq/q96XhGYrQrb8vtQPCT/aKvmkNA5KbWvM51bc/D2/ci8NZJCIx0Iz0eyd 2bzOV+Ukts0aAbKJh6PiKlvis96nVWTv2+Nypz1cXtgwO/y1GTgDtnVDmwNNbnVXpoRD PhWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=shCXcyxtEV+PObx4FGPw5EtfpPZpaNL00TQ+i+W44i4=; b=Hu0cKOW0Rvv6UqhLMUA8qGrbTSmJ7mdtdwOc/YXFBgUPVr/wSqrY1XX3KZGHD0rbYT Jqe1tdhW+MPX8/L6FXeRo/chAwk4NorKzATcCPNvN8U8D9JwzqLq9AXn3zSh9h5DYeHa QM/NGXGi8onDq5jnWr5plfieEOA25hRJi8Yc7O3Zvowl8AGISql9yFPCidb0BriVyahW 3+l6tdX8z+BjLmyG5zCIK1u+lMzYwa6aBRQ4WBAN4OOTJMmRb7yGcC5zVOmnnpzK3Ug/ mAx6tmY4/r5VmdH0HziaLOflsTI0PzmHzh4576NbEd1UWHPQlzh1RkktsrRptZEDDEaX drpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=UFmzkG/V; 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=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8-v6si10024713pll.146.2018.04.06.08.10.23; Fri, 06 Apr 2018 08:10:37 -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=@virtuozzo.com header.s=selector1 header.b=UFmzkG/V; 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=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752037AbeDFPJY (ORCPT + 99 others); Fri, 6 Apr 2018 11:09:24 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:7616 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751967AbeDFPJG (ORCPT ); Fri, 6 Apr 2018 11:09:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=shCXcyxtEV+PObx4FGPw5EtfpPZpaNL00TQ+i+W44i4=; b=UFmzkG/VbXwcGvFpIU6dyeKuxPLhBTs+2YlHj8iL7ATD9fPK/7tr72jlRq3NfRDgHH9R7+z4ms+7V2s6WeKU2UIJmsFDkVE1ZT567HTZKfWPe9afPBqj6Vk93qOy0loKBZJ8ymvzf6wAznrGDNy4EqJ2I9DCmu6OcRNkUxOKfvY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from [172.16.25.12] (195.214.232.6) by VI1PR08MB3264.eurprd08.prod.outlook.com (2603:10a6:803:3d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Fri, 6 Apr 2018 15:09:03 +0000 Subject: Re: [PATCH] mm-vmscan-dont-mess-with-pgdat-flags-in-memcg-reclaim-v2-fix To: Shakeel Butt Cc: Andrew Morton , Mel Gorman , Tejun Heo , Johannes Weiner , Michal Hocko , Linux MM , LKML , Cgroups References: <20180406135215.10057-1-aryabinin@virtuozzo.com> From: Andrey Ryabinin Message-ID: <406e02a5-16d4-7cd3-de01-24bee60eab02@virtuozzo.com> Date: Fri, 6 Apr 2018 18:09:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0202CA0025.eurprd02.prod.outlook.com (2603:10a6:3:e4::11) To VI1PR08MB3264.eurprd08.prod.outlook.com (2603:10a6:803:3d::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff625532-0a00-41e6-2da6-08d59bd055ed X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:VI1PR08MB3264; X-Microsoft-Exchange-Di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UlfCkGCLBxijKL4cWTe5VEm0d/Hocw6ovqY+guJcOUD0o0IxADZyTlmmJqpfY0iO7NSdSiroWYyERDF4fMvVn9ZjZe6dqjpDc4lWSX2RV3e0V37/ILNO37c0VSrQwgdvtHqctkUUwSvdg91rAAvG0DyZMPFfqDBK8TAzmRENO4wNtNeCrUG9i0JtiyASuA21HN8R6ma4bADEQpI1angxVLCpnD8k55G+/aNtx6eA37PiKGyT4uU7lljgDQ8UNPM4CL3Y3DfjHqlAIT/XJ1WDUQiZ2PqWChLNe5diXNuvaIVkyqjKZBT34vUbLoloNiBsmJsW75/4R4qX2gGpNkEk2OU8Io00t+HE0TDrofbcC3O;4:qaHBrwLzO2ZU4cjR8ftA0q+w3Of4hCOdO+Q0+80OP630Am1eNc6PkG28sciCxDEaznhSvGuSLVvaczvIfpNA7SngFhm1rHfMRcT9FYLcGOGxb+2VOhlESOZqAhDiKWCjEl+oIG/b7Dx8Zt25ZUZk3h0Cr7Jiz1ffVO42BlRsLbXF918IZTXCAhUDEIsh+A+TjhOepUGOu8/AQ9Fc1viS0uwS+mNPy/gCT18+OM+gS/e8Uvq9+uAyF90tEpbh0sVy1krVX1ZROYs3ncHnXyrV0A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(3002001)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011);SRVR:VI1PR08MB3264;BCL:0;PCL:0;RULEID:;SRVR:VI1PR08MB3264; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(346002)(376002)(39850400004)(396003)(366004)(39380400002)(189003)(199004)(305945005)(52116002)(65826007)(55236004)(316002)(76176011)(7736002)(476003)(2906002)(77096007)(58126008)(65956001)(956004)(11346002)(186003)(5660300001)(50466002)(446003)(486006)(36756003)(66066001)(64126003)(23676004)(68736007)(2616005)(47776003)(2486003)(16526019)(230700001)(81156014)(86362001)(8676002)(386003)(8936002)(3846002)(81166006)(31696002)(65806001)(53546011)(26005)(16576012)(53936002)(106356001)(4326008)(97736004)(31686004)(52146003)(6116002)(229853002)(25786009)(54906003)(6666003)(6486002)(6246003)(105586002)(6916009)(478600001)(192303002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR08MB3264;H:[172.16.25.12];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA4TUIzMjY0OzIzOllqSCtsWlNoVU93Rk5lR0haV1JFbjB1UTNt?= =?utf-8?B?SFJRWTRocnNxWURpT0xRYTdxdUZEOWFGakdwZWt6dnkzejU5T2EwV0JEZmxZ?= =?utf-8?B?ckpBVVpDSmpjMjF0WmxSQS9RclVWWmhrUmY5WmRMSnBQNTZLQjlTRnhmZU1w?= =?utf-8?B?amRqYkpHMmZOL3N2cU9LNTRCRmg2aExJSitVN0IwaUpTblNXV2xlM0Vta3Ez?= =?utf-8?B?eG5oNFoyTmowUldJVFFtbXdvdWFBYnRXMTdOeVV1Y3hEblMzRnBuVjBpMjAv?= =?utf-8?B?Tzc3UGpkZDFVQ3dvOWVuM3QzeE4xU3hocjFsZW4xSytOTjl0OVcvZFNJZk9m?= =?utf-8?B?aERMc2V6RjFVZXhjd2licm0yM2FtQU9NRGFpZ1FuMXJuTnVETW5DaTVNZUY2?= =?utf-8?B?Mk4xdjhodnJBS3RabnBQTFF4N0I3U2F5OEJCdEJNVjE2aXJUNE01QnIzTTBv?= =?utf-8?B?eXFCM0Zveld0OWdWeVFzeHI5Ym1HNEgyaGhVbUJQS2diVzRJeVZQWitaRUpO?= =?utf-8?B?SHVra1JtU2V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Fk75nNmePRWadG261lhhcItKBLFChZn4xG0GQaAVkgAZYA0eExOvHux5dM4y7g/W/8LIFxIbkE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 15:09:03.2246 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff625532-0a00-41e6-2da6-08d59bd055ed X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3264 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/06/2018 05:37 PM, Shakeel Butt wrote: >> >> @@ -2482,7 +2494,7 @@ static inline bool should_continue_reclaim(struct pglist_data *pgdat, >> static bool pgdat_memcg_congested(pg_data_t *pgdat, struct mem_cgroup *memcg) >> { >> return test_bit(PGDAT_CONGESTED, &pgdat->flags) || >> - (memcg && test_memcg_bit(PGDAT_CONGESTED, memcg)); >> + (memcg && memcg_congested(pgdat, memcg)); > > I am wondering if we should check all ancestors for congestion as > well. Maybe a parallel memcg reclaimer might have set some ancestor of > this memcg to congested. > Why? If ancestor is congested but its child (the one we currently reclaim) is not, it could mean only 2 things: - Either child use mostly anon and inactive file lru is small (file_lru >> priority == 0) so it's not congested. - Or the child was congested recently (at the time when ancestor scanned this group), but not anymore. So the information from ancestor is simply outdated.