From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D60B3164C5 for ; Thu, 20 Aug 2026 09:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219239; cv=none; b=NWC9rwmT1bTwap+owFsPg9fmME7mDZD/8Jg0geXQmRiMLrTH9SE9iaY2BIU+8ya2UFlbdeL1DIgMxoco6RNMO4KDD43TPLKtr9LH2r8W5exlT4xm30RYHBXygUqMsk66yazmKnEueXtN/Y5w0Ec1wwMWWWd14ViGrw5J4+y4xEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219239; c=relaxed/simple; bh=RBA+20Wa7VTk/zHXlotHY/RE6v/RD6D8rHGUfDI4L4M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kIoChhxJrLAfhBpBEvrZxlSiSq6EVf5OmD3Wi2ep+DKLC5GUlPvHCq3kvGbyffO6RaL3qVpCYoopUB+6qINhgBWyTS+hcm1s+QYcPxNLwGb1UqJq7VLiUU4+U7LOSeMU0Ja8xCo1d4yOj9+EZz0sy5X6gx3cR3S0ATIeI6LbT14= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Abx4AY4C; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Abx4AY4C" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-38dc4553f62so2739346a91.0 for ; Thu, 20 Aug 2026 02:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1787219227; x=1787824027; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=8e+fOyON/SbAUU8WoHWfPyNmaOSf1udt8NJoA3KGL/s=; b=Abx4AY4CSb7Yawcw4wqnX5a9Kg/98hcygdZyBOnV4/pR8EaBiogol7ylBLKi4MzWWY r+IBUonXn2bJz1HNj5JHz4ATbSvT4zgj4i6IvpSocRUDLQcXHxa36UrvjHT9Vd7ulU6/ 2qO9QZGlJjMXP4gNIKFWJ4iYqWhIbvmeCK6hg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787219227; x=1787824027; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8e+fOyON/SbAUU8WoHWfPyNmaOSf1udt8NJoA3KGL/s=; b=Nyb56DdpYTFknlrE4mtbukNNYcBI9n7p5LTnsa/x6J6XXaY8cL9ypTi4l+t7Ob2msx 4e8rLZQJ+aaCiI8fRF+wJ2hDiOHgMeg8EoXoGg0G40z86zdpeGwQDNlgXvKLTa3mGCvr 8naEKiXqaHICpjZ0EVhKUJ8yHbxVoonnrddZjxKS4NPuZ6e09crEoCzs8B1tiNs2C76f C9dRQ5cxKbqlF5T1YSB37xWC/Yvu/wJeMguDYlAOYzOg8Mm52so054/NOO+RlzMAXD+W Jv3hW3th4srS9xn7u9cQdHwnrr/BN1fGancRwjyphnlsn4HWf7qwfsMdJlIDaWFJXU5M txoQ== X-Forwarded-Encrypted: i=1; AHgh+RpszoQDXDvcmioKfWBCXdolMhN4N79kaE568g7zrw4j4b0EV0eCMU6PnvCQjZooeHGOuoRgr6yWvZwF5Ao=@vger.kernel.org X-Gm-Message-State: AFuF++nVHTkDKRjpfhDzNydZ5L52yt5SFlsJa3u0FWQ8jrJPgJXfBzzJ b/L9X9Cirw9eZwjaqlVtgAzN/zsOoRSw0oZZfplHlpsirgTDnmjAFWRKPie46s/g3A== X-Gm-Gg: AR+sD10LLIIG4bm8f5uXd0SMta68GoPOOixhNXwXWmxm48E55T5BmYR6cEDQVkpIzy7 /YlVIdofWBsfIeTdBlBicckJxCwCEM8ibp6FR5USp4hb2xHlmsWKLnRed6rTV89N4cs+HkTqDfL fzNiRKs/0GmGBt/oOVbz68kc1uSdr/umL80dfm4F7UE6zmXujaBD82wxMt37IGDcBYpsUabqfmb qqlQxHSO/J4CjiRS0w58mwBcGqM+thBVbbEorRQ00S7dsKnpm1jxS6ADUM4wdrKwLhqrbzW7NOK F9owHGWrGUNbJhAJC6RQm1TQ8QGLAGGHmuT5Y4aov8JM1yOiJnwbSb9hun8HxsmL9kfw0LdtfsV CBGNY5wa6HcILJZ8LVmwuM1Qif79/7cFQDnLcDKy6chZAVFjRd+f15vygoqq9r7H+Q9sqr6TWtF 3W8Dl7YAg22jbvOq57TMj0nbfx91tZTIDDlk5e0MB74XU+pCoMWuvJgnST0wQ3A8Ysj+qqz3Px+ reXY6fhmcJYr/aGMxh+9LLcFc35 X-Received: by 2002:a17:90b:380e:b0:38e:57a3:f218 with SMTP id 98e67ed59e1d1-395810c693cmr20983198a91.13.1787219227414; Thu, 20 Aug 2026 02:47:07 -0700 (PDT) Received: from google.com ([2a00:79e0:2031:6:7beb:7701:c87e:f611]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3957faf6849sm5851279a91.10.2026.08.20.02.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 02:47:06 -0700 (PDT) Date: Thu, 20 Aug 2026 18:47:03 +0900 From: Sergey Senozhatsky To: Peter Zijlstra Cc: Sergey Senozhatsky , Miklos Szeredi , fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] fuse: permit freezing while waiting for request answer Message-ID: References: <20260819023542.561653-1-senozhatsky@chromium.org> <20260820084933.GA4036497@noisy.programming.kicks-ass.net> <20260820091018.GA4120091@noisy.programming.kicks-ass.net> <20260820093402.GB1837346@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260820093402.GB1837346@noisy.programming.kicks-ass.net> On (26/08/20 11:34), Peter Zijlstra wrote: > On Thu, Aug 20, 2026 at 06:24:29PM +0900, Sergey Senozhatsky wrote: > > On (26/08/20 11:10), Peter Zijlstra wrote: > > > On Thu, Aug 20, 2026 at 06:07:18PM +0900, Sergey Senozhatsky wrote: > > > > On (26/08/20 10:49), Peter Zijlstra wrote: > > > > > Message-ID: <20260820084933.GA4036497@noisy.programming.kicks-ass.net> > > > > > > > > > > On Wed, Aug 19, 2026 at 12:03:32PM +0200, Miklos Szeredi wrote: > > > > > > Why is this unsafe exactly? Does that unsafeness apply to > > > > > > filesystems? If so why do we allow freezing while blocked on > > > > > > sb_start_write()? > > > > > > > > > > Getting frozen with lock A held, while another task is blocked on A in > > > > > an unfreezable state results in the system not being freezable. > > > > > > > > Right, but then the system says "suspend failed" (tasks refuse to freeze > > > > after 20sec) and just thaws everything back in? > > > > > > People don't like suspend failing. People like to close their lid, throw > > > laptop in bag, and expect laptop to not cook itself to death. > > > > Sure, that's exactly the problem I'm looking at. Throwing TASK_FREEZABLE > > addresses some of the cases. Failing laptop suspend because of uncontended > > VFS lock is not an uncommon scenario for us. Ideally, however, we need > > some sort of server/client aware suspend, maybe moving clients to cgroup C > > and server to cgroup S, and freezing those in strict order. Or teaching PM > > that some tasks cannot be frozen in random order during suspend (e.g. a > > special flag PM_FREEZE_ME_LAST). > > > > fuse is not the only subsystem that doesn't fit current random order suspend. > > Another troublemaker for us is notify, which basically has the same server/client > > architecture (where both sides are user-space processes). > > Then propose patches creating freeze order. > > PM_FREEZE_ME_LAST is going to be trouble I think, before long you'll > need PM_FREEZE_ME_REALLY_LAST or somesuch nonsense. We probably need more than one, yeah. This doesn't take into consideration relations between tasks within a priority group. If client A holds a lock and enters freezer, and client B sleeps on that lock, then this group cannot be suspended. We need clients to reach some freezer checkpoint, instead of doing in-place freezing. > Using cgroups for this also doesn't sound right. This begins sounding pessimistic. cgroup-s sounded solid to me, because this moves all the clients to that save freezer checkpoint when they don't hold any locks. The only problem is that if a task never reaches "return from syscall" then we fail suspend. (I'm only talking about user-space tasks here, in the context of fuse or inotify.) Why don't cgroups sound right to you?