Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp543183ybl; Fri, 6 Dec 2019 02:09:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxgAgP0RsXt/wQSFJzssiqWfLDmNMnXLNFb6i+B/3OiuxV5SCwVmnixV1+ffCfHkNpYHwN5 X-Received: by 2002:aca:fc06:: with SMTP id a6mr5345745oii.12.1575626985058; Fri, 06 Dec 2019 02:09:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575626985; cv=none; d=google.com; s=arc-20160816; b=DE/frtIdaqQBiv1UsGHhGSGM8aB5jjyy0xj2vXWw4TgAeWExG2+5YLmgg8TqS1pJ9x Dg/W91RNdsmqh6QyV8CSWEN6MulYdZDb0Rm+IbKj35kS0oLiYc8FR1jY6cn5Xp15+4A0 SkKZhpHoWfb4GoeCeHiXjUtGtQ4/R+ixN35CRhDEIYcvaTXzPANiyBKpy+/9gm11dRH1 2VBifyKph1L1Buha+mZEN/53orcuzsxU8XNehYTQnyqtzOLPPcNR0XSRPObJUjPqmuf8 6th9RTKQorsglE88bSOu+/ywE+sbvr5ohLtcZi12bbMmkicgTGbTMmY/ly8oe/+buEjP OOew== 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; bh=ZgEefvOziF7z8mrF0WSJDLRpK1yoVeyxX5+8c1qtWd8=; b=Dz4pBpQ+X7E+z0NGoqm+RaiZ2y71Yrq1eADWsbmkrBNg6+MK4bbANLu4eTyJKimxex O/d1y2ytAHYr7b2fQLRe8yL5XrvZR/8qxOSjlyIrtCQ9mUIyJmxkSPJte8B1URpzj3Sg lHTHPERWQjGUrcIBL91l7Ekcm8zcul09wvOUdIEOHe/yG1dzznZodEME++GtpMT73hgB g5d+MyVBqZ55zT0pjP2SHMPscqA8pvCdZKL8AFOr/XUj9D80ENjYAODoKcHPxHWYKBlI rA+g/XooJFrIoqE6HrtR1wF0LjTsiRxfgXw46TywnHh0pHNl0KHCGI6RYIg1tWwMcWjY NZdQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n65si2408870oib.262.2019.12.06.02.09.32; Fri, 06 Dec 2019 02:09:45 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbfLFKJF (ORCPT + 99 others); Fri, 6 Dec 2019 05:09:05 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37623 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726084AbfLFKJF (ORCPT ); Fri, 6 Dec 2019 05:09:05 -0500 Received: by mail-wr1-f65.google.com with SMTP id w15so7134300wru.4; Fri, 06 Dec 2019 02:09:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZgEefvOziF7z8mrF0WSJDLRpK1yoVeyxX5+8c1qtWd8=; b=ofbqXxLUpt+f4orqUBASv7mzvuuiytJi6rquais0s5d7bPXuqb2Cfgd5WmUscxyibP xIzRnO8mfb9okhAje29nO7euJjoi6Ghv7L78klNwWhwPsP1j84Y1gsH0V9fF1aE8C4qA eBm95VAaydWRyrcZD+KevSfV7ZlRno02uILQDguu9Q5DYW+/T3CCAABuoy7uxXwBPkqX dwfR1ZNzRkhfur40wSIhPUYWGXo0lZ9ya0cKdFlcZDKEJHWC7qqy9RIiVfdAuaAkLeOF +rOwEAuKZMJlFKiYpnK0JuOGbjsx1ZfuIUCJnkHdqBqOXG310ARvqVe4HAVe7KLkyDYM KfiQ== X-Gm-Message-State: APjAAAXI2tmAzLc5dn53x2BZgSHGgukBHOE8qAQo3SHVqjjaeX5g1StV jR4D3tJtnp/m7T0Mn/705DQ= X-Received: by 2002:a5d:6901:: with SMTP id t1mr13926482wru.94.1575626942441; Fri, 06 Dec 2019 02:09:02 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id c2sm15761600wrp.46.2019.12.06.02.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 02:09:01 -0800 (PST) Date: Fri, 6 Dec 2019 11:09:00 +0100 From: Michal Hocko To: Dave Chinner Cc: Andrey Ryabinin , Pavel Tikhomirov , Andrew Morton , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Johannes Weiner , Vladimir Davydov , Roman Gushchin , Shakeel Butt , Chris Down , Yang Shi , Tejun Heo , Thomas Gleixner , "Kirill A . Shutemov" , Konstantin Khorenko , Kirill Tkhai , Trond Myklebust , Anna Schumaker , "J. Bruce Fields" , Chuck Lever , linux-nfs@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] mm: fix hanging shrinker management on long do_shrink_slab Message-ID: <20191206100900.GM28317@dhcp22.suse.cz> References: <20191129214541.3110-1-ptikhomirov@virtuozzo.com> <4e2d959a-0b0e-30aa-59b4-8e37728e9793@virtuozzo.com> <20191206020953.GS2695@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191206020953.GS2695@dread.disaster.area> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 06-12-19 13:09:53, Dave Chinner wrote: > [please cc me on future shrinker infrastructure modifications] > > On Mon, Dec 02, 2019 at 07:36:03PM +0300, Andrey Ryabinin wrote: > > > > On 11/30/19 12:45 AM, Pavel Tikhomirov wrote: > > > We have a problem that shrinker_rwsem can be held for a long time for > > > read in shrink_slab, at the same time any process which is trying to > > > manage shrinkers hangs. > > > > > > The shrinker_rwsem is taken in shrink_slab while traversing shrinker_list. > > > It tries to shrink something on nfs (hard) but nfs server is dead at > > > these moment already and rpc will never succeed. Generally any shrinker > > > can take significant time to do_shrink_slab, so it's a bad idea to hold > > > the list lock here. > > registering/unregistering a shrinker is not a performance critical > task. We have had a bug report from production system which stumbled over a long [u]nmount which was stuck on a shrinker {un}register path waiting for the lock. This wouldn't be a big deal most of the time but [u]mount were part of the login session in this case. This was on an older distribution kernel and e496612c5130 ("mm: do not stall register_shrinker()") helped a bit but not really for shrinkers that take a lot of time. > If a shrinker is blocking for a long time, then we need to > work to fix the shrinker implementation because blocking is a much > bigger problem than just register/unregister. Absolutely agreed here. -- Michal Hocko SUSE Labs