[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wi12AStfPrXLjki_SLc5qqDwYX21bJLp10mynNQj7u8FA@mail.gmail.com>
Date: Fri, 3 Dec 2021 10:25:17 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andreas Gruenbacher <agruenba@...hat.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>,
Al Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Will Deacon <will@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-btrfs <linux-btrfs@...r.kernel.org>
Subject: Re: [PATCH v2 0/4] Avoid live-lock in fault-in+uaccess loops with
sub-page faults
On Fri, Dec 3, 2021 at 10:12 AM Andreas Gruenbacher <agruenba@...hat.com> wrote:
>
> It happens when you mmap a file and write the mmapped region to
> another file, for example.
Do you actually have such loads? Nobody should use mmap() for
single-access file copy purposes. It's slower than just doing the copy
exactly due to page fault overhead.
In other words, you seem to be worrying about the performance of a
load that is _explicitly_ badly written. You should be fixing the
application, not making the kernel do stupid things.
Also, it's worth noting that that situation should be caught by the
page-in code, which will map multiple pages in one go
(do_fault_around() - for when the pages are cached), and do the
readahead logic (filemap_fault() - for when the pages aren't in the
page cache).
Both of which are a lot more important than the "synchronously fault
in pages one at a time".
Linus
Powered by blists - more mailing lists