From patchwork Fri Feb 24 15:43:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 9590781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9EEC9601AE for ; Fri, 24 Feb 2017 16:41:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AA8328741 for ; Fri, 24 Feb 2017 16:41:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F45128755; Fri, 24 Feb 2017 16:41:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16B4128741 for ; Fri, 24 Feb 2017 16:41:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751292AbdBXQl2 (ORCPT ); Fri, 24 Feb 2017 11:41:28 -0500 Received: from merlin.infradead.org ([205.233.59.134]:58672 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273AbdBXQlS (ORCPT ); Fri, 24 Feb 2017 11:41:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UKp3IEtPw69CtbGFclLVfp22fBF4qEHON1pMizBeJzY=; b=H4CoacCZpF9H48T37661/3p820 0pa5qb1nAI6LPRqY4etGCJcdNCWEqZ3S4wnzg0FAtmSRMA/uSWuLl8ve4M0zKuHE7bYely7i8NVU2 ZRsrq/qe5jSB347jzkzvEqsTCD4PMwAmlewpbSgzbv9E4hjvTr5mOWJvxRtRqIKUtsCMhsSJAY9pI K+v8HwiMayo/Mg98Hep8iQSEADcS7OKVY3kt3fw+yc/DJJTzpwr1Uefz23Xp9NG73tDcSId6+zgZ6 6H/ysCFabuFsZGhTNW18E+FRS3iQXR/LvFjS1xVVmi7yY3v/tp9nzrd7OixwVngF8WyHzSzw0cZl7 U0bjUsrg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=twins.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1chIta-0004OV-0O; Fri, 24 Feb 2017 16:39:02 +0000 Received: by twins.programming.kicks-ass.net (Postfix, from userid 0) id EF9F4125317A3; Fri, 24 Feb 2017 17:39:03 +0100 (CET) Message-Id: <20170224162044.333662852@infradead.org> User-Agent: quilt/0.63-1 Date: Fri, 24 Feb 2017 16:43:36 +0100 From: Peter Zijlstra To: Al Viro , Linus Torvalds , Chris Mason Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, David Howells , elena.reshetova@intel.com, ishkamiel@gmail.com, dwindsor@gmail.com, gregkh@linuxfoundation.org, peterz@infradead.org Subject: [RFC][PATCH 07/10] orangefs: Use RCU for destroy_inode References: <20170224154329.478276481@infradead.org> MIME-Version: 1.0 Content-Disposition: inline; filename=peterz-fs-inode-6.patch Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Peter Zijlstra (Intel) --- fs/orangefs/super.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -115,6 +115,13 @@ static struct inode *orangefs_alloc_inod return &orangefs_inode->vfs_inode; } +static void orangefs_i_callback(struct rcu_head *head) +{ + struct inode *inode = container_of(head, struct inode, i_rcu); + struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode); + kmem_cache_free(orangefs_inode_cache, orangefs_inode); +} + static void orangefs_destroy_inode(struct inode *inode) { struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode); @@ -123,7 +130,7 @@ static void orangefs_destroy_inode(struc "%s: deallocated %p destroying inode %pU\n", __func__, orangefs_inode, get_khandle_from_ino(inode)); - kmem_cache_free(orangefs_inode_cache, orangefs_inode); + call_rcu(&inode->i_rcu, orangefs_i_callback); } /*