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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 7E044C47404 for ; Fri, 11 Oct 2019 18:45:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CD3E2089F for ; Fri, 11 Oct 2019 18:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728689AbfJKSpy (ORCPT ); Fri, 11 Oct 2019 14:45:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52114 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728374AbfJKSpy (ORCPT ); Fri, 11 Oct 2019 14:45:54 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2F0C8AC6FD; Fri, 11 Oct 2019 18:45:54 +0000 (UTC) Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4067560600; Fri, 11 Oct 2019 18:45:54 +0000 (UTC) Subject: Re: [PATCH] fs: avoid softlockups in s_inodes iterators To: Matthew Wilcox Cc: fsdevel , Jan Kara , Josef Bacik References: <841d0e0f-f04c-9611-2eea-0bcc40e5b084@redhat.com> <20191011183253.GV32665@bombadil.infradead.org> From: Eric Sandeen Message-ID: <6e67a39c-88ed-f6a9-16a7-6ae9560a1112@redhat.com> Date: Fri, 11 Oct 2019 13:45:53 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191011183253.GV32665@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Fri, 11 Oct 2019 18:45:54 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 10/11/19 1:32 PM, Matthew Wilcox wrote: > On Fri, Oct 11, 2019 at 11:49:38AM -0500, Eric Sandeen wrote: >> @@ -698,6 +699,13 @@ int invalidate_inodes(struct super_block *sb, bool kill_dirty) >> inode_lru_list_del(inode); >> spin_unlock(&inode->i_lock); >> list_add(&inode->i_lru, &dispose); >> + >> + if (need_resched()) { >> + spin_unlock(&sb->s_inode_list_lock); >> + cond_resched(); >> + dispose_list(&dispose); >> + goto again; >> + } >> } >> spin_unlock(&sb->s_inode_list_lock); >> > > Is this equivalent to: > > + cond_resched_lock(&sb->s_inode_list_lock)); > > or is disposing of the list a crucial part here? I think we need to dispose, or we'll start with the entire ~unmodified list again after the goto: -Eric