Received: by 10.192.165.156 with SMTP id m28csp1148779imm; Fri, 13 Apr 2018 14:15:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/lEOXaecY3DxqW8VC8rXGNbtOccXfjfFPjZTYHvwT8tdzfdk8xzGaav3CaS5E+zbQBhDkn X-Received: by 10.99.127.21 with SMTP id a21mr5257420pgd.162.1523654154846; Fri, 13 Apr 2018 14:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523654154; cv=none; d=google.com; s=arc-20160816; b=UT2PqXdDzoBm4ZRTBhhgHhqR7H/in1RWPknYP3J+i2qKFJdw4gng4aTbCbqrE5swCp NtJ2ze05IwlBcPeIgrnzEDpkVHT1UzY4zbkQBkHcN6Iyy7JgqAaiDL26PDYE0m0ADlMU f/k4g6XyVhTK7HHPbROkrudU8KsGmArZV3wbvcvhk9h3q9YkRhgew2kiGjuKGtcvfQiH VZFEuwNyt+HgHPlqn/lR9S7yu6Z+UCPGG+iF8DwZCpm/AwrQ7ClWolNsdtFy4knZjEw/ sLp3I6eWbHhZegd8fIdGvjVxebWnWXCuJ1q4CU7Aulr3KVlhHSskH3LEtee1TNeM6HXI H3YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=wCYRGlJ0h71bFNry7bUQQoA7mJko4SNCx9QpYYD+fxM=; b=UVi5WROY/DJAJzjWLOO6mHaRSStdTO+fKFQW0BunrElUbhOEktzRJfVhLSnpIZ7t8A GmTcMs7j0C4qyQBC7vo1HsyUKAv4jYZd4XrmYbiAIDt6Pw2bOemoW/Dqr4NM/YIdpyDj ORFTWxoobHsyPdH+YyDXsqk75ipVIGxpKsCA3FT8sWTZEDLamKI/fZBSfRIy6FhEB2WP Fth5Ki6UFdzxy6vlhBSdsSnh3ELXj1uvsEVe+8XUCD8mrmVG+sT64zwBdygi5Lf/irGK 1VyYqu5PqUkDVRAp4PGLDMq5Yrx3sWA1peUSj/s2vk3G0RbdVFk/Zcp5jICnx8yqRD+t WqsA== 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 k6si4719245pgn.599.2018.04.13.14.15.40; Fri, 13 Apr 2018 14:15:54 -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 S1751771AbeDMVOd (ORCPT + 99 others); Fri, 13 Apr 2018 17:14:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53804 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbeDMVOc (ORCPT ); Fri, 13 Apr 2018 17:14:32 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.71]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9B1A0CAC; Fri, 13 Apr 2018 21:14:31 +0000 (UTC) Date: Fri, 13 Apr 2018 14:14:30 -0700 From: Andrew Morton To: Khazhismel Kumykov Cc: nborisov@suse.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, David Rientjes , Alexander Viro , Goldwyn Rodrigues , Jeff Mahoney , Davidlohr Bueso , Linus Torvalds Subject: Re: [PATCH] fs/dcache.c: re-add cond_resched() in shrink_dcache_parent() Message-Id: <20180413141430.2788e2562e3e24bd273fe78b@linux-foundation.org> In-Reply-To: <20180413202823.204377-1-khazhy@google.com> References: <20180413181350.88831-1-khazhy@google.com> <20180413202823.204377-1-khazhy@google.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. That block comment over `struct select_data' is not a good one. "It returns zero iff...". *What* returns zero? select_collect()? No it doesn't, it returns an `enum d_walk_ret'. Perhaps the comment is trying to refer to select_data.found. And the real interpretation of select_data.found is, umm, hard to describe. "Counts the number of dentries which are on a shrink list or which were moved to the dispose list". Why? What's that all about? This code needs a bit of thought, documentation and perhaps a redo, I suspect.