Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4533811imm; Wed, 30 May 2018 07:23:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6hQd3l3EsldZbfijWcpn8vWsUwFLhyL9UHpbfRhUhVWn0eUH7KEReOKT89JvBByNvUmAY X-Received: by 2002:a62:c2c7:: with SMTP id w68-v6mr2971480pfk.174.1527690190938; Wed, 30 May 2018 07:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527690190; cv=none; d=google.com; s=arc-20160816; b=EEA0x66LWgpvq40TgBLwTWBMXRcYuNdpw4knrxbiOB9DQN9E3jN2C1R/lrEiIDFDnN rs15lPJE+LmPXegDUr+6eWAzHh+3QKhz9bH7gyWMRwZzOn3N2dTNQrjPjCAxZwApfo/u STR1oGCDBM1myT29vSsHsnU603ILBYiE+OhuHLDd54aeGT6o1efZk4zHdRTKa98APWQ8 9zKZMEcxQ9Ax2mxIfRJubTAFm76UePCPCwZjLQw8iUyY7WFC+7G/DbGx8SI68mTxcPvV UsXjRIKj3G01uTa4PpnaGjUZyzL78Vlpm5TFKQiv8EcdELtH6feEGRDrWjiY0N58KqdS JoCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=TZnaSOsS+Zv4gvIDYBZ0jyJ4dZvIGKR51+XtE59UsDo=; b=nFZZbKwYTFCZ3qWkdfJqP8yaQI74YgGChsdiimIQJZNPEmxkx9b1thdWeKiRe8g1PQ g1CLMTC9p70LQHNPmcOqqOyL8elWKNq2SDGURsXfUEO2dShkluVntaWq+tZ8X3u2qSZE M+q4ODBu5yE+wYHhqaHvBPqeGlkYUQiKEkx53E0UhrIlGHV/CKqewotCIUz5ZFaxVgeZ SWpjwwuYOdhOQceJ/Q4kYnK7XfxSfoTJpsiYpw5ty/Iq4Og3tZ5GCQJwv+OWZANFwsh0 MZ03BAQdctOLgwr23RHVCDuT4HZbndzZu+NBX9e7zTfgY0UTFqSpibqMNMsR2RYpG5RR M6CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=YA4QVfFr; 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 g5-v6si1609982pgp.91.2018.05.30.07.22.56; Wed, 30 May 2018 07:23:10 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=YA4QVfFr; 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 S1753443AbeE3OWJ (ORCPT + 99 others); Wed, 30 May 2018 10:22:09 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:39896 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094AbeE3OWE (ORCPT ); Wed, 30 May 2018 10:22:04 -0400 Received: by mail-ot0-f194.google.com with SMTP id l12-v6so21328545oth.6 for ; Wed, 30 May 2018 07:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TZnaSOsS+Zv4gvIDYBZ0jyJ4dZvIGKR51+XtE59UsDo=; b=YA4QVfFrI41MsAGFqpYZOTavE7aZ3bw1FwBeVROwkda9eK3JE8DzgNo8MFbUoXkFGU Tdt7Lo3ryTSo3qDscmkiObaO0Kq82aQNwH80H5Ha5hXPiLxnbgkv84k0YFjX6XmA61EV SY9SlDWSKbFG9FyZwT3pBSdzQQIu1pjKsB5Ew= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TZnaSOsS+Zv4gvIDYBZ0jyJ4dZvIGKR51+XtE59UsDo=; b=VrlZnfBBls8PAbhKP2RvRDQIYr4z5lFJqjYGIYce8ZkybB3MyC+nSIWE768Jxqg78K 81Xu4vLkfVke6QB49aroBBBWMMdQkPHlD5TBe0dUIKdvY9ffGZmNafE33YNozpZ4WRZ5 CahK2KECUHmpeTs6lU0oUYmCri8Eeq2+yjzQCMIpw0UA6tmWARn6l7DmIBCkLpY40ECp 0sg8+1UC2xyTVO3drtc41D+SKpbWCSHiMuhRZNJgLK5w8Tn/pVS7uGwUZHyYUyMOn19Z OaLgkx/J9tqUOisJflI7bp0YKpFYdmLHgwDAGbP41wRlot15KCEfmWuLJNSbKlTtJbPx SvJQ== X-Gm-Message-State: ALKqPwfE/MDVww0Y9t/Le95FVoCdna3URAGPWsEz6nwY0UO7hbZ6A2Zn DtChCycPuNr+q3gEXPzhEhYDcsrQovyj8zYu8VbrIw== X-Received: by 2002:a9d:30d2:: with SMTP id r18-v6mr1994157otg.221.1527690123621; Wed, 30 May 2018 07:22:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:5303:0:0:0:0:0 with HTTP; Wed, 30 May 2018 07:22:02 -0700 (PDT) X-Originating-IP: [176.63.54.97] In-Reply-To: <20180206162518.tdoszuggqxpkrqvn@quack2.suse.cz> References: <20180202175328.GL1121507@devbig577.frc2.facebook.com> <20180202175414.GM1121507@devbig577.frc2.facebook.com> <20180206162518.tdoszuggqxpkrqvn@quack2.suse.cz> From: Miklos Szeredi Date: Wed, 30 May 2018 16:22:02 +0200 Message-ID: Subject: Re: [PATCH 2/2] FUSE: fix congested state leak on aborted connections To: Jan Kara Cc: Tejun Heo , Jens Axboe , Joshua Miller , kernel-team , Johannes Weiner , stable , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 6, 2018 at 5:25 PM, Jan Kara wrote: > On Fri 02-02-18 09:54:14, Tejun Heo wrote: >> If a connection gets aborted while congested, FUSE can leave >> nr_wb_congested[] stuck until reboot causing wait_iff_congested() to >> wait spuriously which can lead to severe performance degradation. >> >> The leak is caused by gating congestion state clearing with >> fc->connected test in request_end(). This was added way back in 2009 >> by 26c3679101db ("fuse: destroy bdi on umount"). While the commit >> description doesn't explain why the test was added, it most likely was >> to avoid dereferencing bdi after it got destroyed. >> >> Since then, bdi lifetime rules have changed many times and now we're >> always guaranteed to have access to the bdi while the superblock is >> alive (fc->sb). >> >> Drop fc->connected conditional to avoid leaking congestion states. >> >> Signed-off-by: Tejun Heo >> Reported-by: Joshua Miller >> Cc: Johannes Weiner >> Cc: Miklos Szeredi >> Cc: Jan Kara >> Cc: stable@vger.kernel.org > > Yeah, this should be fine AFAICT but my knowledge of FUSE is very cursory. > Anyway: > > Acked-by: Jan Kara Can't say I fully understand how the global "is any bdi congested" state is used in direct reclaim, but the patch is an obvious improvement, so applied. Thanks, Miklos