Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2817401yba; Sun, 28 Apr 2019 09:42:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4xn1B4SAW7MiDapG02i9B5OTqAaNnNv0FBUX6vdXrqJwNY/ZdeKSHvZp5ED52F2a959Zv X-Received: by 2002:a63:5041:: with SMTP id q1mr31800781pgl.386.1556469772162; Sun, 28 Apr 2019 09:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556469772; cv=none; d=google.com; s=arc-20160816; b=goPqRLrCSkpiR2G8pZUQjuiJmYRNdTzHQrxAWZ6zHXB4T+RuJAiVEZukH7P60c6j27 o4mHhHYXpgAofyajAclYAxeG16BnHEa98C9UYk6RkplknvlMmmt7HMO6ZipEMIDmhfJF vIkXK3C/g6AHL/3H772T8sLjCYx99xHkxJwlLCZrhO338kiDfyGM9eVxsfgm77snOR2J n2u2nqCn7oKlgBW/HBTLe2pUGholYyqrKqj+ieUrbMm9lZUj2rmrljLBUR4tYkpMq6W/ I1E6Emu/1bU6W4Rgwkibz5CuxMnGdoUQKvhpGqmRQnqwl3H9uk8go54fDZDWRI6vld38 6yxg== 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=rrDswD8S3DK/c5BjJ2b1m//6+vjqpD4piU/902NXd1U=; b=su4TwFQIRTjAFPsNB7e3lNbJqSDMtVGNK9OGZKCLukWoUBl1A1lMFxDIYfzS54s68p PF9LZw1VhQcZ5ZLtLwbWY5NZR9Ksi27dJ7P+I+PbjGzIBy2JlqPlnjXiVm3NcO72AJJT TjcIogVt7I1kYI4SBXPIi+uRspqdwqEgXP1WfiYZG7kcSch0eEJIoaqOKjggH0WB5pHy Dpia9o+hwdRN7p65w86RYNfSDcGZPAirSYp9L6HB0p1AeLlJ5dzUGSuyl7H6ijE95F0x I3PYDKM42fhMWnbc8GXaC6DHu7DfekfCTvfKTCClaxNIN2wFDrECe43TUAgidPlpA/q6 NAsQ== 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 f63si31076443pff.107.2019.04.28.09.42.36; Sun, 28 Apr 2019 09:42:52 -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 S1726987AbfD1Qke (ORCPT + 99 others); Sun, 28 Apr 2019 12:40:34 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:41822 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726220AbfD1Qke (ORCPT ); Sun, 28 Apr 2019 12:40:34 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hKmqs-0004Vn-Ld; Sun, 28 Apr 2019 16:40:30 +0000 Date: Sun, 28 Apr 2019 17:40:30 +0100 From: Al Viro To: Jeff Layton Cc: Linus Torvalds , Ilya Dryomov , ceph-devel@vger.kernel.org, Linux List Kernel Mailing , linux-cifs Subject: Re: [GIT PULL] Ceph fixes for 5.1-rc7 Message-ID: <20190428164030.GC23075@ZenIV.linux.org.uk> References: <342ef35feb1110197108068d10e518742823a210.camel@kernel.org> <20190425200941.GW2217@ZenIV.linux.org.uk> <86674e79e9f24e81feda75bc3c0dd4215604ffa5.camel@kernel.org> <20190426165055.GY2217@ZenIV.linux.org.uk> <20190428043801.GE2217@ZenIV.linux.org.uk> <7bac7ba5655a8e783a70f915853a0846e7ff143b.camel@kernel.org> <20190428144850.GA23075@ZenIV.linux.org.uk> <20190428155216.GB23075@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190428155216.GB23075@ZenIV.linux.org.uk> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 28, 2019 at 04:52:16PM +0100, Al Viro wrote: > On Sun, Apr 28, 2019 at 11:47:58AM -0400, Jeff Layton wrote: > > > We could stick that in ceph_dentry_info (->d_fsdata). We have a flags > > field in there already. > > Yes, but... You have it freed in ->d_release(), AFAICS, and without > any delays. So lockless accesses will be trouble. You could RCU-delay the actual kmem_cache_free(ceph_dentry_cachep, di) in there, but I've no idea whether the overhead would be painful - on massive eviction (e.g. on memory pressure) it might be. Another variant is to introduce ->d_free(), to be called from __d_free() and __d_free_external(). That, however, would need another ->d_flags bit for presence of that method, so that we don't get extra overhead from looking into ->d_op... Looking through ->d_release() instances, we have afs: empty, might as well have not been there autofs: does some sync stuff (eviction from ->active_list/->expire_list) plus kfree_rcu ceph: some sync stuff + immediate kmem_cache_free() debugfs: kfree(), might or might not be worth RCU-delaying ecryptfs: sync stuff (path_put for ->lower) + RCU-delayed part fuse: kfree_rcu() nfs: kfree() overlayfs: a bunch of dput() (obviously sync) + kfree_rcu() 9p: sync So it actually might make sense to move the RCU-delayed bits to separate method. Some ->d_release() instances would be simply gone, as for the rest... I wonder which of the sync parts can be moved over to ->d_prune(). Not guaranteed to be doable (or a good idea), but... E.g. for autofs it almost certainly would be the right place for the sync parts - we are, essentially, telling the filesystem to forget its private (non-refcounted) references to the victim.