Received: by 10.192.165.156 with SMTP id m28csp10536imm; Sun, 15 Apr 2018 15:36:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx49K/fQhVFBVmpiI4K7gORHWGp+R+++iTjSgHrB4kzwAzEO+Dcm1hgM3rRkPGR9wrttGyYjV X-Received: by 2002:a17:902:207:: with SMTP id 7-v6mr13212800plc.261.1523831769759; Sun, 15 Apr 2018 15:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523831769; cv=none; d=google.com; s=arc-20160816; b=tONH+PvZUBAzdFKAzeJiCwFaCcOYrC6sFrnm4N1NAvDMvgU6gYV5u/mqlNzSyriTcV wvNSs5yqKqRmLXK3eZzDXWmEDDw7f8WVl9bCluo3Xm/rAlphumw7tSGT+1/4dq6H3804 7GS5ifnw1TKbrPU4np9YiIWFN8XzImAuGO4Z+LGrNfCWcjHklRsJqPcFoaEdpBIAC96S wIbjeFU/hAEp72N/xamI5GX3KnzpKCRkoOoC3yBMQ9lrQEq9t/uzT6Z2Ko3q5i945iw8 jpF52nUkSzYzNn+J79xUg5PUKjJtjwWq6zcupcW7srIaYfTQB7BrKcJO/B/oDudY1JOp 7GvA== 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=wdk4yXw61dO1gY0GSYcfiJjoV6N4J1VR5jUFqtGQhDM=; b=NLB5tHW8kPRSB93L7gElTGftEfTvrlUbbu4VKoDdVpEs0LFD5fiy4tulymXrRzQBiJ GyeVJ0ZLFzoOJIq7J1XlXdFMJD2CQmMarSK6ouXq3yxK4zLN+wMRamoM9Yc895LCeQsO b6JyMeBz+zm639briOiD+ydtNRnepWPbjDc0qxxrhZm+MP1syZkRlrC0EddVShGztQxA AGK5OrLBy+VblUmnaAPTDHtD6KSDGHXCTBbTYmDwZu+NAZ1gwWp7H4Poi8yOwOQ6+ytK odEC/46Bu2VMixc6OaMR7RW6LQzl/vxJYzBeY9CIPdPhoHS9FXhd7Vwgmigt/L1EIL43 l7JQ== 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 v12-v6si7757657plo.29.2018.04.15.15.35.54; Sun, 15 Apr 2018 15:36:09 -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 S1752662AbeDOWeq (ORCPT + 99 others); Sun, 15 Apr 2018 18:34:46 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:54422 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbeDOWeo (ORCPT ); Sun, 15 Apr 2018 18:34:44 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1f7qEJ-0003og-N4; Sun, 15 Apr 2018 22:34:39 +0000 Date: Sun, 15 Apr 2018 23:34:39 +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: <20180415223439.GC30522@ZenIV.linux.org.uk> References: <20180413141430.2788e2562e3e24bd273fe78b@linux-foundation.org> <3362fb2d-85ff-86af-399f-698c986e46cc@suse.com> <20180414080206.GV30522@ZenIV.linux.org.uk> <20180414205846.GW30522@ZenIV.linux.org.uk> <20180415005056.GX30522@ZenIV.linux.org.uk> <20180415204054.GA30522@ZenIV.linux.org.uk> <20180415215455.GB30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180415215455.GB30522@ZenIV.linux.org.uk> 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 Sun, Apr 15, 2018 at 10:54:55PM +0100, Al Viro wrote: > On Sun, Apr 15, 2018 at 09:40:54PM +0100, Al Viro wrote: > > > BTW, the current placement of cond_resched() looks bogus; suppose we > > have collected a lot of victims and ran into need_resched(). We leave > > d_walk() and call shrink_dentry_list(). At that point there's a lot > > of stuff on our shrink list and anybody else running into them will > > have to keep scanning. Giving up the timeslice before we take care > > of any of those looks like a bad idea, to put it mildly, and that's > > precisely what will happen. > > > > What about doing that in the end of __dentry_kill() instead? And to > > hell with both existing call sites - dput() one (before going to > > the parent) is obviously covered by that (dentry_kill() only returns > > non-NULL after having called __dentry_kill()) and in shrink_dentry_list() > > we'll get to it as soon as we go through all dentries that can be > > immediately kicked off the shrink list. Which, AFAICS, improves the > > situation, now that shrink_lock_dentry() contains no trylock loops... > > > > Comments? > > What I mean is something like this (cumulative diff, it'll obviously need > to be carved up into 3--4 commits): ... and carved-up version is in vfs.git#work.dcache. Could syzbot folks hit it with their reproducers?