lkml.org 
[lkml]   [2020]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH 1/3] lib: Add a generic copy_oldmem_page()
    On Tue, Jul 14, 2020 at 1:06 PM Christoph Hellwig <hch@infradead.org> wrote:
    > 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@infradead.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?

    I was under the impression that the kdump kernel only accesses a small
    amount of memory itself and would allocate its mem_map to fit that but
    not pages of that were used by the kernel it is dumping.

    Arnd

    \
     
     \ /
      Last update: 2020-07-14 13:39    [W:4.916 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site