linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hui Su <sh_def@163.com>,
	hughd@google.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, pankaj.gupta.linux@gmail.com,
	lkp@intel.com
Subject: Re: [PATCH v2] mm/shmem.c: make shmem_mapping() inline
Date: Sat, 14 Nov 2020 19:11:58 +0000	[thread overview]
Message-ID: <20201114191158.GN17076@casper.infradead.org> (raw)
In-Reply-To: <20201114105039.4d44e3036e22e10c9a70912c@linux-foundation.org>

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.


  reply	other threads:[~2020-11-14 19:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14  5:51 [PATCH v2] mm/shmem.c: make shmem_mapping() inline Hui Su
2020-11-14 18:50 ` Andrew Morton
2020-11-14 19:11   ` Matthew Wilcox [this message]
2020-11-15 16:19   ` Hui Su

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=20201114191158.GN17076@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=pankaj.gupta.linux@gmail.com \
    --cc=sh_def@163.com \
    /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;
as well as URLs for NNTP newsgroup(s).