linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux F2FS Dev Mailing List
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [GIT PULL] f2fs for 5.18
Date: Tue, 22 Mar 2022 13:37:24 -0400	[thread overview]
Message-ID: <51cded74-3135-eed8-06d3-0b2165e3b379@redhat.com> (raw)
In-Reply-To: <CAHk-=wgsmvoJFKFWxQ2orEVUOWH1agk9iUNZ=-DFh5OXZL=Ldw@mail.gmail.com>

On 3/22/22 13:22, Linus Torvalds wrote:
> On Mon, Mar 21, 2022 at 1:39 PM Jaegeuk Kim <jaegeuk@kernel.org> wrote:
>> In this cycle, f2fs has some performance improvements for Android workloads such
>> as using read-unfair rwsems [...]
> I've pulled this, but that read-unfair rwsem code looks incredibly
> dodgy. Doing your own locking is always a bad sign, and it ahs
> traditionally come back to bite us pretty much every time. At least it
> uses real lock primitives, just in a really odd way.
>
> The whole notion of making an rwsem unfair to readers sounds really
> really odd.  I mean, the whole and only _point_ of an rwsem is to
> allow concurrent readers, and traditionally if it's unfair it's unfair
> to _writers_ because that tends to be better for throughput (but
> unfairness can cause horrible latency).
>
> So it smells like there's something bad going on in f2fs.
>
> That said, I'm adding Waiman to the cc here in case he would have
> ideas at least for a cleaner interface. Our rw_semaphores are
> explicitly trying to be fair, because unfairness (the other way) was
> such a big problem.
>
> I'm wondering it the optimistic read lock stealing is bothering f2fs?

I don't believe it is the optimistic read lock stealing code that is 
bothering f2fs.

AFAICS, the read-unfair rwsem code is created to resolve a potential 
lock starvation problem that they found on linux-5.10.y stable tree. I 
believe I have fixed that in the v5.11 kernel, see commit 2f06f702925 
("locking/rwsem: Prevent potential lock starvation"). However that 
commit is not in the stable tree. In fact, I have moved forward and 
taken out reader optimistic spinning but added just optimistic lock 
stealing instead. I believe the problem would have solved by including 
that patch series in their build. I haven't gotten any response as to 
whether they had tested this or not.

Apparently they prefer to upstream this stop-gap solution.

Cheers,
Longman



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2022-03-22 17:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21 20:39 [f2fs-dev] [GIT PULL] f2fs for 5.18 Jaegeuk Kim
2022-03-22 17:22 ` Linus Torvalds
2022-03-22 17:37   ` Waiman Long [this message]
2022-03-22 17:50     ` Linus Torvalds
2022-03-22 20:58       ` Jaegeuk Kim
2022-06-15 20:13         ` Pavel Machek
2022-06-16 17:02           ` Jaegeuk Kim
2022-03-23  0:34       ` Tim Murray via Linux-f2fs-devel
2022-03-23  2:03         ` Linus Torvalds
2022-03-23 16:26           ` Jaegeuk Kim
2022-03-23 17:06             ` Linus Torvalds
2022-03-23 21:21               ` Jaegeuk Kim
2022-03-23  7:33   ` Christoph Hellwig
2022-03-23 16:48     ` Jaegeuk Kim
2022-03-23 16:49       ` Christoph Hellwig
2022-03-23 17:00         ` Jaegeuk Kim
2022-03-23 19:28       ` Waiman Long
2022-03-23 21:25         ` Jaegeuk Kim
2022-03-22 18:32 ` pr-tracker-bot

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=51cded74-3135-eed8-06d3-0b2165e3b379@redhat.com \
    --to=longman@redhat.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).