linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: Jerome Glisse <jglisse@redhat.com>,
	Ralph Campbell <rcampbell@nvidia.com>,
	 David Airlie <airlied@linux.ie>,
	"Kuehling, Felix" <Felix.Kuehling@amd.com>,
	 Dan Williams <dan.j.williams@intel.com>,
	 "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	 "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	 "Deucher, Alexander" <Alexander.Deucher@amd.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Christoph Hellwig <hch@lst.de>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [GIT PULL] Please pull hmm changes
Date: Wed, 18 Dec 2019 08:53:05 -0800	[thread overview]
Message-ID: <CAHk-=wgR7OSE9Bn2+MbOYDbiu7n1RQaQhdc6gkEywXL9rMFcpw@mail.gmail.com> (raw)
In-Reply-To: <20191218145913.GO16762@mellanox.com>

On Wed, Dec 18, 2019 at 6:59 AM Jason Gunthorpe <jgg@mellanox.com> wrote:
>
> Do you think calling it 'mmn_subscriptions' is clear?

Why do you want that "mmn"?

Guys, the "mmn" part is clear from the _context_. The function name is

When the function name is something like "mmu_interval_read_begin()",
and the filename is "mm/mmu_notifier.c", you do NOT NEED silly
prefixes like "mmn" for local variables.

They add NOTHING.

And they make the code an illegible mess.

Yes, global function names need to be unique, and if they aren't
really core, they want some prefix that explains the context, because
global functions are called from _outside_ the context that explains
them.

But if it's a "struct mmu_interval_notifier" pointer, and it's inside
a file that is all about these pointers, it shouldn't be called
"mmn_xyz".  That's not a name. That's line noise.

So call it a "notifier". Maybe even an "interval_notifier" if you
don't mind the typing. Name it by something _descriptive_. And if you
want.

And "subscriptions" is a lovely name. What does the "mmn" buy you?

Just to clarify: the names I really hated were the local variable
names (and the argument names) that were all entirely within the
context of mm/mmu_notifier.c. Calling something "mmn_mm" is a random
jumble of letters that looks more like you're humming than you're
speaking.

Don't mumble. Speak _clearly_.

The other side of "short names" is that some non-local conventions
exist because they are _so_ global. So if it's just a mm pointer, call
it "mm". We do have some very core concepts in the kernel that
permeate _everything_, and those core things we tend to have very
short names for. So whenever you're working with VM code, you'll see
lots of small names like "mm", "vma", "pte" etc. They aren't exactly
clear, but they are _globally_ something you read and learn when you
work on the Linux VM code.

That's very diofferent from "mmn" - the "mmn" thing isn't some global
shorthand, it is just a local abomination.

So "notifier_mm" makes sense - it's the mm for a notifier. But
"mmn_notifier" does not, because "mmn" only makes sense in a local
context, and in that local context it's not any new information at
all.

See the difference? Two shorthands, but one makes sense and adds
information, while the other is just unnecessary and pointless and
doesn't add anything at all.

                Linus


  reply	other threads:[~2019-12-18 16:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 20:42 [GIT PULL] Please pull hmm changes Jason Gunthorpe
2019-11-30 18:03 ` Linus Torvalds
2019-11-30 18:23   ` Linus Torvalds
2019-12-03  2:42     ` Jason Gunthorpe
2019-12-05 16:03       ` Jerome Glisse
2019-12-11 22:57         ` Jason Gunthorpe
2019-12-13 10:19           ` Daniel Vetter
2019-12-18 14:59             ` Jason Gunthorpe
2019-12-18 16:53               ` Linus Torvalds [this message]
2019-12-18 18:37                 ` Jason Gunthorpe
2019-12-18 19:33                   ` Linus Torvalds
2019-12-05 23:03       ` John Hubbard
2019-12-11 22:47         ` Jason Gunthorpe
2019-11-30 18:35 ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2020-08-04 15:06 Jason Gunthorpe
2020-08-05 20:33 ` pr-tracker-bot
2020-06-01 18:25 Jason Gunthorpe
2020-06-02 22:20 ` pr-tracker-bot
2020-03-30 17:57 [GIT PULL] Please pull HMM changes Jason Gunthorpe
2020-03-30 19:54 ` Nathan Chancellor
2020-03-30 20:08   ` Jason Gunthorpe
2019-07-30 11:58 [GIT PULL] Please pull hmm changes Jason Gunthorpe
2019-07-30 20:40 ` pr-tracker-bot
2019-07-09 19:24 Jason Gunthorpe
2019-07-15  2:48 ` Linus Torvalds
2019-07-15  3:00 ` pr-tracker-bot

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='CAHk-=wgR7OSE9Bn2+MbOYDbiu7n1RQaQhdc6gkEywXL9rMFcpw@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=Alexander.Deucher@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dan.j.williams@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=jgg@mellanox.com \
    --cc=jglisse@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rcampbell@nvidia.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).