Received: by 10.192.165.156 with SMTP id m28csp2100800imm; Sat, 14 Apr 2018 14:00:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/7X2f3JgfwZ0N3yS/p3vn9KKZ50FNLH72732jBZk0zAA+F7xBOrlZ/9Y8FOpWg2bDslRMO X-Received: by 10.99.191.12 with SMTP id v12mr8131170pgf.54.1523739616136; Sat, 14 Apr 2018 14:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523739616; cv=none; d=google.com; s=arc-20160816; b=vj6kFsj41bgKKygBgx+2e9K3OvrCw5O9fr9EZveyZdGGweHVbP8Q29S8tBkcwJ5duA e5TdYyikuxXk1Z5JrXLirTzYNy5zKUqa2CDkLJe350XbnOvhTY/Bv5yoOxlca1rIwh8y SE3wzmbUDKPFq1Yy2i6nWfK5XsXU/P5mybXZbTlndcV0CAQrR4N4nidAmpJg5mXNHnRK yE+ZZlOulsYQKuiKodLedR0kEf5sMgWYzSIQMXU/Oziod06Zaa0XIYHl0POmlSUhadSH YdynjH0VhM8YG7zz4QFxcwdojTPpN0MxLtyo9ZgUiuAtdySve5X6IOWPLlTdNE2HkyWK 1vaw== 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:arc-authentication-results; bh=UoC9FEE3m9OzkFQuRzFe5J0UNhxLRgbOe+PEISwSDu8=; b=dGcVt/Bmw5bl6E+pC60qsk/tBk7vM1Gul2vRn5zvIa5ROlr+D0RCG6Kif+XT7OI4NR DfXbIhPvRvsmO2ziodOfNkxRCvWa1V8FKpC3VmKoezLsX9+m3nNhPC4d8d1zhZw8mCwH GDSVmebjfLrVM4uoumYWXMmQ+hTAYOJcfqX+YojvwUqdqvroFVlr51onG5hVVMhZnz/o XlS8z8Tz5knQS5YZorkumK6lyWsj4O/qm+ruSK/yC0VteRUdfdnPv3Wq0q/s+eDVAVYV 5pIWTNNRVpDwYD3es6gP2J2k3gjSQs/Q7Ufjo1Ls7nbia9tsJ5ShQX3d5s3D2USRO3ob SQZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16-v6si8536818plk.79.2018.04.14.14.00.02; Sat, 14 Apr 2018 14:00:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751877AbeDNU6z (ORCPT + 99 others); Sat, 14 Apr 2018 16:58:55 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36836 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbeDNU6x (ORCPT ); Sat, 14 Apr 2018 16:58:53 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1f7SFy-00068H-TK; Sat, 14 Apr 2018 20:58:46 +0000 Date: Sat, 14 Apr 2018 21:58:46 +0100 From: Al Viro To: Linus Torvalds Cc: Nikolay Borisov , Andrew Morton , Khazhismel Kumykov , linux-fsdevel , Linux Kernel Mailing List , David Rientjes , Goldwyn Rodrigues , Jeff Mahoney , Davidlohr Bueso Subject: Re: [PATCH] fs/dcache.c: re-add cond_resched() in shrink_dcache_parent() Message-ID: <20180414205846.GW30522@ZenIV.linux.org.uk> References: <20180413181350.88831-1-khazhy@google.com> <20180413202823.204377-1-khazhy@google.com> <20180413141430.2788e2562e3e24bd273fe78b@linux-foundation.org> <3362fb2d-85ff-86af-399f-698c986e46cc@suse.com> <20180414080206.GV30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 14, 2018 at 09:36:23AM -0700, Linus Torvalds wrote: > But it does *not* make sense for the case where we've hit a dentry > that is already on the shrink list. Sure, we'll continue to gather all > the other dentries, but if there is concurrent shrinking, shouldn't we > give up the CPU more eagerly - *particularly* if somebody else is > waiting (it might be the other process that actually gets rid of the > shrinking dentries!)? > > So my gut feel is that we should at least try doing something like > this in select_collect(): > > - if (!list_empty(&data->dispose)) > + if (data->found) > ret = need_resched() ? D_WALK_QUIT : D_WALK_NORETRY; > > because even if we haven't actually been able to shrink something, if > we hit an already shrinking entry we should probably at least not do > the "retry for rename". And if we actually are going to reschedule, we > might as well start from the beginning. > > I realize that *this* thread might not be making any actual progress > (because it didn't find any dentries to shrink), but since it did find > _a_ dentry that is being shrunk, we know the operation itself - on a > bigger scale - is making progress. > > Hmm? That breaks d_invalidate(), unfortunately. Look at the termination conditions in the loop there...