From patchwork Tue Jan 15 10:19:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10764237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 735971390 for ; Tue, 15 Jan 2019 10:19:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 626D52B2FF for ; Tue, 15 Jan 2019 10:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56CC62B303; Tue, 15 Jan 2019 10:19:19 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 481862B2FF for ; Tue, 15 Jan 2019 10:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727328AbfAOKTR (ORCPT ); Tue, 15 Jan 2019 05:19:17 -0500 Received: from relay.sw.ru ([185.231.240.75]:36276 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfAOKTR (ORCPT ); Tue, 15 Jan 2019 05:19:17 -0500 Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gjLoQ-00012Q-L3; Tue, 15 Jan 2019 13:19:14 +0300 Subject: [PATCH 0/7] fuse: Improve disconnect scheme and avoid taking fpq->lock on hot paths From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org Date: Tue, 15 Jan 2019 13:19:13 +0300 Message-ID: <154754701031.4244.8089449938935364463.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 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 There is no a reason to set individual FR_ABORTED state for every request, since fuse_abort_conn() aborts all unlocked requests at once. FR_ABORTED bit and fpq->io list just allow fuse_copy_aborted() to end some of requests, which are in the middle of fuse_dev_do_read() and fuse_dev_do_write(). But this is not a big deal, since these functions abort the requests themselves. This patchset introduces a better scheme for fuse_abort_conn(), which allows to remove excess flags and fpq->io, and optimizes hot paths fuse_dev_do_read() and fuse_dev_do_write() by avoiding taking fpq->lock there. --- Kirill Tkhai (7): fuse: Check for fc->connected in fuse_dev_alloc() fuse: Move flush_bg_queue() up in fuse_abort_conn() fuse: Drop and reacquire fc->lock in middle of fuse_abort_conn() fuse: Add fud pointer to struct fuse_copy_state fuse: Introduce generic fuse_copy_aborted() fuse: Kill unused FR_ABORTED, FR_LOCKED and FR_PRIVATE flags fuse: Kill fuse_pqueue::io list and avoid taking fpq->lock on hot paths fs/fuse/dev.c | 131 ++++++++++++++++-------------------------------------- fs/fuse/fuse_i.h | 20 ++------ fs/fuse/inode.c | 10 ++++ 3 files changed, 52 insertions(+), 109 deletions(-) -- Signed-off-by: Kirill Tkhai