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=-6.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,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 2DB60C43461 for ; Tue, 8 Sep 2020 15:42:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D418924794 for ; Tue, 8 Sep 2020 15:42:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D418924794 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5FBF3900004; Tue, 8 Sep 2020 11:42:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D0FE6B005A; Tue, 8 Sep 2020 11:42:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E73F900004; Tue, 8 Sep 2020 11:42:10 -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 367186B0055 for ; Tue, 8 Sep 2020 11:42:10 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id EDC9E8248047 for ; Tue, 8 Sep 2020 15:42:09 +0000 (UTC) X-FDA: 77240310378.04.fall82_2400def270d5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id B5162800AD0F for ; Tue, 8 Sep 2020 15:42:09 +0000 (UTC) X-HE-Tag: fall82_2400def270d5 X-Filterd-Recvd-Size: 2207 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Sep 2020 15:42:09 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2D8E6AC26; Tue, 8 Sep 2020 15:42:07 +0000 (UTC) Subject: Re: [PATCH] mm/vmscan: fix infinite loop in drop_slab_node To: Chris Down , zangchunxin@bytedance.com Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song References: <20200908142456.89626-1-zangchunxin@bytedance.com> <20200908150945.GA1301981@chrisdown.name> From: Vlastimil Babka Message-ID: <07c6ebf1-e2b3-11a2-538f-4ac542a4373b@suse.cz> Date: Tue, 8 Sep 2020 17:42:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200908150945.GA1301981@chrisdown.name> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: B5162800AD0F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On 9/8/20 5:09 PM, Chris Down wrote: > drop_caches by its very nature can be extremely performance intensive -- if > someone wants to abort after trying too long, they can just send a > TASK_KILLABLE signal, no? If exiting the loop and returning to usermode doesn't > reliably work when doing that, then _that's_ something to improve, but this > looks premature to me until that's demonstrated not to work. Hm there might be existings scripts (even though I dislike those) running drop_caches periodically, and they are currently not set up to be killed, so one day it might surprise someone. Dropping should be a one-time event, not a continual reclaim. Maybe we could be a bit smarter and e.g. double the threshold currently hardcoded as "10" with each iteration? > zangchunxin@bytedance.com writes: >>In one drop caches action, only traverse memcg once maybe is better. >>If user need more memory, they can do drop caches again. > > Can you please provide some measurements of the difference in reclamation in > practice? >