mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Ira Weiny <ira.weiny@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Prathu Baronia <prathubaronia2011@gmail.com>,
	linux-kernel@vger.kernel.org, chintan.pandya@oneplus.com,
	Prathu Baronia <prathu.baronia@oneplus.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH v4 1/1] mm/highmem: Remove deprecated kmap_atomic
Date: Fri, 5 Nov 2021 17:35:22 +0000	[thread overview]
Message-ID: <YYVrWkLs8zrTs6r9@casper.infradead.org> (raw)
In-Reply-To: <20211105165616.GZ3538886@iweiny-DESK2.sc.intel.com>

On Fri, Nov 05, 2021 at 09:56:16AM -0700, Ira Weiny wrote:
> Also I wonder if memset_page could be used?  It would end up mapping the page
> 2x sometimes.

That was the point of this function existing, to avoid the
double-mapping.

> As an aside I think flush_dcache_page() needs to be in memset_page() for
> completeness but I'm a bit afraid of adding it with the current controversy...
> :-/

Looks like we now have agreement that it does need to be added, and I
agree with you; send a patch.

At some point, I'm probably going to need to foliate the mem*_page
helpers.  I've just added:

static inline void folio_zero_segments(struct folio *folio,
                size_t start1, size_t end1, size_t start2, size_t end2)
{
        zero_user_segments(&folio->page, start1, end1, start2, end2);
}

static inline void folio_zero_segment(struct folio *folio,
                size_t start, size_t end)
{
        zero_user_segments(&folio->page, start, end, 0, 0);
}

static inline void folio_zero_range(struct folio *folio,
                size_t start, size_t length)
{
        zero_user_segments(&folio->page, start, start + length, 0, 0);
}

but I imagine when we foliate btrfs, we'll need to expand the helpers.
I'll probably do something similar to zero_user_segments; have
out-of-line versions for HIGHMEM and inline versions for !HIGHMEM
(we can do the entire folio with HIGHMEM, but need to go page-by-page
on !HIGHMEM).

      reply	other threads:[~2021-11-05 17:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  7:32 [PATCH v4 0/1] " Prathu Baronia
2021-02-04  7:32 ` [PATCH v4 1/1] " Prathu Baronia
2021-02-11  0:33   ` Ira Weiny
2021-02-11 23:56     ` Andrew Morton
2021-11-05 13:49       ` Matthew Wilcox
2021-11-05 16:51         ` Matthew Wilcox
2021-11-05 16:58           ` Ira Weiny
2021-11-05 17:23             ` Matthew Wilcox
2021-11-05 18:38               ` Ira Weiny
2021-11-08 10:12                 ` Prathu Baronia
2021-11-05 16:56         ` Ira Weiny
2021-11-05 17:35           ` Matthew Wilcox [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=YYVrWkLs8zrTs6r9@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=chintan.pandya@oneplus.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=prathu.baronia@oneplus.com \
    --cc=prathubaronia2011@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    /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®