Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jun 2013 09:21:30 -0500
From:      Alan Cox <alc@rice.edu>
To:        "arm@freebsd.org" <arm@freebsd.org>
Cc:        Jeff Roberson <jroberson@jroberson.net>, Alan Cox <alc@rice.edu>
Subject:   generic_bs_map()
Message-ID:  <51CEED6A.9090802@rice.edu>

next in thread | raw e-mail | index | archive | help
Jeff and I have been looking at the various kmem_alloc() calls
throughout the kernel, and when we came to generic_bs_map() on arm, I
was a bit puzzled.  In short, I believe that generic_bs_map() should be
calling kmem_alloc_nofault() instead of kmem_alloc().  It appears to me
that generic_bs_map() only wants a virtual address range from kmem_*,
which is what kmem_alloc_nofault() does.  In contrast, kmem_alloc() also
allocates and maps physical memory at the returned address range.  In
the case of generic_bs_map(), allocating and mapping physical memory is
pointless because generic_bs_map() overwrites those mappings with its
own.  So, the physical pages allocated by kmem_alloc() are wasted.

Neither Jeff nor I have arm hardware to verify this change.  Could
someone here please try it out?

Thanks,
Alan





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51CEED6A.9090802>