mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: 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: Mon, 9 Sep 2024 12:31:23 +0000	[thread overview]
Message-ID: <2a190823-3089-46a7-9e0f-14d77ae15692@wdc.com> (raw)
In-Reply-To: <CAL3q7H4nvqLwk7g=rZ3NVp+W2ttAHN7mi8QO-qy7hqhe0AzoJA@mail.gmail.com>

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.

  reply	other threads:[~2024-09-09 12:31 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 [this message]
2024-09-10 14:50         ` David Sterba

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=2a190823-3089-46a7-9e0f-14d77ae15692@wdc.com \
    --to=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®