mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: Filipe Manana <fdmanana@kernel.org>,
	Johannes Thumshirn <jth@kernel.org>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	"open list:BTRFS FILE SYSTEM" <linux-btrfs@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] btrfs: don't take dev_replace rwsem on task already holding it
Date: Tue, 10 Sep 2024 16:50:18 +0200	[thread overview]
Message-ID: <20240910145018.GA17038@suse.cz> (raw)
In-Reply-To: <2a190823-3089-46a7-9e0f-14d77ae15692@wdc.com>

On Mon, Sep 09, 2024 at 12:31:23PM +0000, Johannes Thumshirn wrote:
> On 09.09.24 14:29, Filipe Manana wrote:
> >>>
> >>> So the idea I suggested was not like this.
> >>> The idea was just to not ever down_read() the semaphore if the current
> >>> task is the replace task.
> >>
> >> So your idea is sth like the following (not yet tested):
> > 
> > Yes, exactly.
> 
> Thanks.
> 
> >>> For my suggestion, since we will skip the locking of the semaphore,
> >>> we'll have to compare "current" with "dev_replace->replace_task"
> >>> without any locking,
> >>> but that's ok and we can use data_race() to silence KCSAN.
> >>
> >> I'll check if KCSAN actually complains about this.
> >>
> >> As for David's remark, do you prefere a pid or a task_struct to be
> >> stored in struct dev_replace?
> > 
> > I'm fine with either one.
> 
> Ok David, your call then. I'm fine with either one as well.

The task struct works, so please use it, thanks.

      reply	other threads:[~2024-09-10 14:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15 12:57 Johannes Thumshirn
2024-08-15 18:17 ` David Sterba
2024-08-19  8:22   ` Johannes Thumshirn
2024-08-26 11:11 ` Filipe Manana
2024-09-09 10:35   ` Johannes Thumshirn
2024-09-09 12:28     ` Filipe Manana
2024-09-09 12:31       ` Johannes Thumshirn
2024-09-10 14:50         ` David Sterba [this message]

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=20240910145018.GA17038@suse.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=jth@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®