Linux Power Management development
 help / color / mirror / Atom feed
From: Askar Safin <safinaskar@gmail.com>
To: quwenruo.btrfs@gmx.com
Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: Long running ioctl and pm, which should have higher priority?
Date: Fri, 17 Oct 2025 13:39:32 +0300	[thread overview]
Message-ID: <20251017103932.1176085-1-safinaskar@gmail.com> (raw)
In-Reply-To: <3a77483d-d8c3-4e1b-8189-70a2a741517e@gmx.com>

Qu Wenruo <quwenruo.btrfs@gmx.com>:
> But there is a question concerning me, which should have the higher 
> priority? The long running ioctl or pm?

Of course, pm.

I have a huge btrfs fs on a laptop.

I don't want scrub to prevent suspend, even if that suspend is happening
automatically.

> Furthermore the interruption may be indistinguishable between pm and 
> real user signals (SIGINT etc).

If we interrupted because of signal, ioctl should return EINTR. This is
what all other syscalls do.

If we were cancelled, we should return ECANCELED.

If we interrupted because of process freeze or fs freeze, then... I
don't know what we should do in this case, but definitely not ECANCELED
(because we are not cancelled). EINTR will go, or maybe something else
(EAGAIN?).

Then, userspace program "btrfs scrub" can resume process if it
got EINTR. (But this is totally unimportant for me.)

Also, please CC me when sending any emails about this scrub/trim bug.

-- 
Askar Safin

  reply	other threads:[~2025-10-17 10:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 21:31 Long running ioctl and pm, which should have higher priority? Qu Wenruo
2025-10-17 10:39 ` Askar Safin [this message]
2025-10-17 10:43   ` Qu Wenruo
2025-10-17 10:46     ` Andrei Borzenkov
2025-10-17 20:51       ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251017103932.1176085-1-safinaskar@gmail.com \
    --to=safinaskar@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox