Received: by 10.192.165.156 with SMTP id m28csp1556444imm; Sat, 14 Apr 2018 01:03:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx49B2lcQPKbX7nhwEdmx1EE6viimvHdIWKm0ZoYI0N4PmUIRucy2VKPKB+4LvbVP2wN0fyrr X-Received: by 10.101.70.8 with SMTP id v8mr6566578pgq.336.1523693018400; Sat, 14 Apr 2018 01:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523693018; cv=none; d=google.com; s=arc-20160816; b=Rw/8NGWqE3GF9j0pD1QA2amtTZ9kfEf2GbDeHX37tZCYEC0xCrGzGF9cHJwShf2Tno ZgCTf4AXabesw3PVAwTfZ+K94Qa4AUnf8Mm7k+25HlPCv8CwjtfUfSNWnIJ+Jm3zfZWM s3ryj+UyazpxUGXTKXPxEOBgBTTqTj1n4IPVSKEGSAHRk6CHv0qgxVsFHlUGz+wkJNoL hWXebzjXs2J6DHvMxFdfyjRpZwElvKq7GNo3OTdCX6edu6TjRlIVwPfVJHPGkEobhqWs 0e0/Egx0EHqMRdZgabsRx8XQXCbQ9WBkyd2VPG7olcC80xMjXdCeuYTu9C6a9JQQszcQ YgQg== 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=LFHm812uhtzBL3acXDRaGv4nX1q/kiyOz+LjYpfjjP4=; b=S1Dwh8lTB+5bJbQfiDd/F6A9sOBQYh7aF0OV+kZ18R9Xluc87pqqBgZ6bk6yV9T0b5 yISVPZUUD6XsCtEJ03kQ+QcHIqHAOzPsyUZil40f+9L/d0NSNuJOOj2jra+ws+s7YP8b lGFcmVyLydaMDHLCXc4htUsaDeMmIx/Wx1Q1iALX9hoqhLozQ9ah4KwG07X/lYe2v2Zc pSWYWYfFAYYxMWAc4DpFb67A76x7/fUKjOCr/5F8kMdr/KJcMGth2tVBgYviDd1S/Whp BEeyrmYseKSgYEKvxhimzfxByi3UOljBDQFcbA16uXaPoMDg2WyXYGd+A7M3cN12F7j4 R5eg== 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 n86si6536559pfj.86.2018.04.14.01.03.24; Sat, 14 Apr 2018 01:03:38 -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 S1750948AbeDNICN (ORCPT + 99 others); Sat, 14 Apr 2018 04:02:13 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:54730 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbeDNICL (ORCPT ); Sat, 14 Apr 2018 04:02:11 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1f7G8M-0003az-Qz; Sat, 14 Apr 2018 08:02:06 +0000 Date: Sat, 14 Apr 2018 09:02:06 +0100 From: Al Viro To: Nikolay Borisov Cc: Andrew Morton , Khazhismel Kumykov , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, David Rientjes , Goldwyn Rodrigues , Jeff Mahoney , Davidlohr Bueso , Linus Torvalds Subject: Re: [PATCH] fs/dcache.c: re-add cond_resched() in shrink_dcache_parent() Message-ID: <20180414080206.GV30522@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3362fb2d-85ff-86af-399f-698c986e46cc@suse.com> 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 10:00:29AM +0300, Nikolay Borisov wrote: > > > On 14.04.2018 00:14, Andrew Morton wrote: > > On Fri, 13 Apr 2018 13:28:23 -0700 Khazhismel Kumykov wrote: > > > >> shrink_dcache_parent may spin waiting for a parallel shrink_dentry_list. > >> In this case we may have 0 dentries to dispose, so we will never > >> schedule out while waiting for the parallel shrink_dentry_list to > >> complete. > >> > >> Tested that this fixes syzbot reports of stalls in shrink_dcache_parent() > > > > Well I guess the patch is OK as a stopgap, but things seem fairly > > messed up in there. shrink_dcache_parent() shouldn't be doing a > > busywait, waiting for the concurrent shrink_dentry_list(). > > > > Either we should be waiting (sleeping) for the concurrent operation to > > complete or we should just bail out of shrink_dcache_parent(), perhaps > > with > > > > if (list_empty(&data.dispose)) > > break; > > > > or similar. Dunno. > > I agree, however, not being a dcache expert I'd refrain from touching > it, since it seems to be rather fragile. Perhaps Al could take a look in > there? "Bail out" is definitely a bad idea, "sleep"... what on? Especially since there might be several evictions we are overlapping with...