From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 0D6A12D97BA for ; Thu, 20 Aug 2026 04:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787201851; cv=none; b=fF9YXwEcHXSqqS65+rRNlEDQT+BSorEYDDIWhhcHxmjiRPH93LR3D3kTGqJeAgqqUZ3iX5Dz+UO7PviJIh4Hnv+wgwT8wHVydZpOkhIk5pr5CYuMNDZQBUlYRKUsGzwrS1ARUMhWLvNW8UixeHhLNlM+lLzf4R4O2ecPJ/lfHDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787201851; c=relaxed/simple; bh=2USlnEWAV/BsZQrU3qAzmNex/6iGANpKQ905z4pSmNU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=odrQQ9cejO9bAV/lIODfqcU/CPUh8b20b2BYd6RW6ZBqMHQTSSTV5gr+6bvxkkU6/dNWBy24ITQpDX9/dqfXC05xwgvq27Fr+C/0HYCwplu7874KVl7poJyGvFVGyQaBGIAXbTNEq/G2n6kmqvZy5oG7u8EdGxwEpq4VS7Q/aU0= 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=Rnb6fY8X; arc=none smtp.client-ip=209.85.214.182 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="Rnb6fY8X" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2cf52d15d88so13929275ad.2 for ; Wed, 19 Aug 2026 21:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1787201849; x=1787806649; 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=t8/KAiE7r+9ujV+X79tz4aj1EOYlpuTPQ/LgkCZoCHE=; b=Rnb6fY8XzmWk++tGPS4marHGGd6HEDv9/s5AJwrDzOPSmMnbeOmfCoQuAwigvuwecT s06SKDVo618FU0QW7K9+DvGeZsFNHfmRn5973eq4Pfj2tYJ+CUy9fhMVVopKlWKAOViZ lgFesUkO4WLS2AmEkgXxLL/99IVJ/+tqjUxoY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787201849; x=1787806649; 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=t8/KAiE7r+9ujV+X79tz4aj1EOYlpuTPQ/LgkCZoCHE=; b=aRfB0c+BwBQNn34YZr0WWVSKyPgh4lBX+bcqeXx768WYeier7IqySSvu29P1ZUupdf kgsHfAw6heK/WQAoyWR6CGCLy2b7AnAMid52zaYLxkK6vJSSBgtBpTzjHXJU41EX3iKU N0YFxyX9cUnLqFP1MdDyBZDLWEk5xT37tVO1I6XWdoD1ZLLC4PGHu2Y0iRxblR8bJBii ZLX0iUYxEUavNU/fRqyRFIeJ7LauC2JX76XqKx4g3XKNthoXlT465ybnGI5wFxwxEol+ 4FyT6jRO4Kcl1h9A9kLnLgZXl9I5HCxhS1a4M0a7ahS/fw6s8D6/Ovdn1KD2qXpMtRjK ZhTQ== X-Forwarded-Encrypted: i=1; AHgh+RpaL/MJpfnDBoMZhaka5nB5r5G6XIoOvigFof1QgNVpI1/vczXFDHw8cNRqZfZUX1EL6hSpnGtlAgy/pkM=@vger.kernel.org X-Gm-Message-State: AFuF++m1esNwM5H/CWIxaLv0yeJY2+zNmZbX1+e6KfUKxXEK+J4KMD8N eaI6hhI2Pl/V83MxLltu9jgDnhGDRKFh5ydB4ENNVj5ipn5HrS9GDNs/AD55ZSLCeg== X-Gm-Gg: AR+sD11XqZn0Wrq6+okqCo9hKLUXjCxDgPkWJBQltdQXspUqis6cASawfdYZdh7Ze5m c/Buf+Dpd3hIfBL7R+N7qWcCOqp/uuTm31i/dOlEvNoKyQoBmXbZxRIDy2z4WxnT9xI3fjAFUZw h8bG7Zq+yERavc/anNynadwSOl3W7lrimxvrv8IL2yIhfxkfItXtyo17IKNW04Q+OBWLTOxSOPx 368mzNkiwuyKKChaQAdebk5OqqgsdqSkYQNgBfSYOWS0bQUEFB+bbDvaxr5ZyN5lBvnKwToynlv /BzxqSvd3NOKebLv5volmsHgaRwUpnqOInCR70dQgXJ2W28NOVEMPIys5OjlUFk9kWMBdqMGHPo ZAWYKmLLaQdTol37tk8WflAeKkRwT4bKQtMuq2yofkzCGszDvnExHxoUTfAz8ln9Lf0oY+q3hw7 umu0l6kJ5lhr5ub5EIYJ36TXDyq0gTsvkhmXLMdrpVn9sTIa0QlEK1j3dvVkjPK1ec0yHFeZRwe 33CNtVBA5/sjjzJI5vHNnmJlwtK X-Received: by 2002:a17:903:3903:b0:2cf:b68a:340 with SMTP id d9443c01a7336-2d5fd6af8acmr188906615ad.10.1787201849305; Wed, 19 Aug 2026 21:57:29 -0700 (PDT) Received: from google.com ([2a00:79e0:2031:6:7beb:7701:c87e:f611]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d62d587eb2sm2002465ad.24.2026.08.19.21.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 21:57:28 -0700 (PDT) Date: Thu, 20 Aug 2026 13:57:11 +0900 From: Sergey Senozhatsky To: Miklos Szeredi Cc: Sergey Senozhatsky , fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Peter Zijlstra , 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> 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: On (26/08/19 12:03), Miklos Szeredi wrote: > On Wed, 19 Aug 2026 at 04:35, Sergey Senozhatsky > wrote: > > > > Suspend freezes tasks in random order and doesn't take into > > consideration producer-consumer dependency that may exist > > between tasks. One example where this can cause issues is: > > fuse server getting frozen ahead of clients, which then get > > stuck waiting for req answers that never come (the server > > is already frozen). > > > > Make all wait-event calls in request_wait_answer() freezer-friendly. > > > > This, however, doesn't address all cases. E.g. in-place > > PM-freeze of a request_wait_answer() task holding a contended > > VFS lock still will block suspend. > > > > Note: this uses TASK_FREEZABLE, not TASK_FREEZABLE_UNSAFE, > > which may trigger debug_locks warning during suspend (if > > request_wait_answer() task holds some locks at the time > > of freeze.) > > This is not okay. I see the "no new users" warning on > TASK_FREEZABLE_UNSAFE, but this needs further discussion. Sure. In RFC patch I had TASK_FREEZABLE_UNSAFE but eventually "don't add new users" won. > Existing users of the _UNSAFE variant are NFS and samba. I haven't > checked the context where these are called. > > Apparently __sb_start_write() uses the safe variant, yet I'm quite > sure it will be called in various locking contexts. We also use "safe" variant in fuse_get_req(). > Why is this unsafe exactly? Does that unsafeness apply to > filesystems? If so why do we allow freezing while blocked on > sb_start_write()? Right, I don't have much to add to the point that maybe file-systems can get a waiver. If we suspend under un-contended VFS lock then it doesn't look like unsafe here (we similarly can sleep indefinitely under the same lock waiting for server reply); if the lock is contended then suspend will fail.