[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200714110549.GA22613@infradead.org>
Date: Tue, 14 Jul 2020 12:05:49 +0100
From: Christoph Hellwig <hch@...radead.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Christoph Hellwig <hch@...radead.org>,
Palmer Dabbelt <palmer@...belt.com>,
Nick Kossifidis <mick@....forth.gr>,
Mark Rutland <mark.rutland@....com>,
Gregory Fong <gregory.0xf0@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Catalin Marinas <catalin.marinas@....com>,
Linus Walleij <linus.walleij@...aro.org>,
Palmer Dabbelt <palmerdabbelt@...gle.com>,
Brendan Higgins <brendanhiggins@...gle.com>,
Marco Elver <elver@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Will Deacon <will@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Uwe Kleine-K??nig <uwe@...ine-koenig.org>,
AKASHI Takahiro <takahiro.akashi@...aro.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>,
Russell King - ARM Linux <linux@...linux.org.uk>,
Matthew Wilcox <willy@...radead.org>,
Mike Rapoport <rppt@...ux.ibm.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Android Kernel Team <kernel-team@...roid.com>,
Petr Mladek <pmladek@...e.com>, zaslonko@...ux.ibm.com,
Kees Cook <keescook@...omium.org>,
Mark Brown <broonie@...nel.org>,
"Vaittinen, Matti" <matti.vaittinen@...rohmeurope.com>,
Ben Dooks <ben-linux@...ff.org>,
Dan Williams <dan.j.williams@...el.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
David Gow <davidgow@...gle.com>,
Randy Dunlap <rdunlap@...radead.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH 1/3] lib: Add a generic copy_oldmem_page()
On Mon, Jul 13, 2020 at 03:39:17PM +0200, Arnd Bergmann wrote:
> On Mon, Jul 13, 2020 at 3:07 PM Christoph Hellwig <hch@...radead.org> wrote:
> > On Fri, Jul 10, 2020 at 08:55:42PM -0700, Palmer Dabbelt wrote:
> > > +ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
> > > + size_t csize, unsigned long offset,
> > > + int userbuf)
> > > +{
> > > + void *vaddr;
> > > +
> > > + if (!csize)
> > > + return 0;
> > > +
> > > + vaddr = memremap(__pfn_to_phys(pfn), PAGE_SIZE, MEMREMAP_WB);
> > > + if (!vaddr)
> > > + return -ENOMEM;
> >
> > Doing a memremap for every page is very inefficient. Also I don't see
> > why you'd want to even do that. All memory is in the direct mapping
> > for RISC-V. For other architecture that support highmem kmap_atomic_pfn
> > would do the job, which is what I'd use in a generic version.
>
> I would expect the 'oldmem' data to not have a 'struct page', which would
> be a problem at least for the generic implementation of kmap_atomic_pfn()
Why do you expect it to not have a struct page?
Powered by blists - more mailing lists