lkml.org 
[lkml]   [2020]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm/shmem.c: make shmem_mapping() inline
On Sat, Nov 14, 2020 at 10:50:39AM -0800, Andrew Morton wrote:
> But really, shmem_mapping() isn't worth an out-of-line call from any
> callsite - it would be best to make it inlined everywhere.
>
> - make shmem_aops global
> - declare shmem_aops in shmem_fs.h
> - export shmem_aops to modules for drivers/dma-buf/udmabuf.c
> - include linux/fs.h in shmem_fs.h for address_space_operations (we already
> include fs.h via swap.h, but we shouldn't depend on that)
> - make shmem_mapping() a static inline in shmem_fs.h.

... or use an AS_ bit to make shmem_mapping() global inline without
exposing the shmem_aops symbol. We're not short of AS_ bits, and it's
probably even cheaper than a pointer comparison.

A really good changelog would explain why we need shmem_mapping()
everywhere that we currently use it. It's not immediately obvious why
so many places need to know.

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