public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-tip-commits@vger.kernel.org,
	Davidlohr Bueso <dbueso@suse.de>,
	Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Rik van Riel <riel@surriel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	dave@stgolabs.net, x86 <x86@kernel.org>
Subject: Re: [tip: x86/mm] x86/mm/pat: Rename pat_rbtree.c to pat_interval.c
Date: Thu, 21 Nov 2019 18:08:49 +0100	[thread overview]
Message-ID: <20191121170849.GB12042@gmail.com> (raw)
In-Reply-To: <CAHk-=wg565YQe6Dmpjg6QJ9aPHvkT7G60iDYS12TZoG+q+hbTw@mail.gmail.com>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, Nov 20, 2019, 22:03 tip-bot2 for Davidlohr Bueso <
> tip-bot2@linutronix.de> wrote:
> 
> >
> > x86/mm/pat: Rename pat_rbtree.c to pat_interval.c
> >
> > Considering that we don't use an rbtree but an interval tree,
> > rename the main file accordingly.
> >
> 
> Wouldn't it be even better to not make the same mistake all over again, and
> instead of naming the file by an implementation detail, it should be named
> by what it does?
> 
> Maybe pat_memtype.c or just pat_manage.c or something?
> 
> Or even just pat.c?

Yeah, so incidentally, just before you made this suggestion yesterday, I 
rearranged the files quite a bit in tip:WIP.x86/mm, and the latest naming 
scheme is:

 dagon:~/tip> ls -l arch/x86/mm/pat/
 total 112
 -rw-r--r-- 1 mingo mingo  5782 Nov 21 06:41 cpa-test.c
 -rw-r--r-- 1 mingo mingo   117 Nov 21 06:41 Makefile
 -rw-r--r-- 1 mingo mingo 32026 Nov 21 06:41 memtype.c
 -rw-r--r-- 1 mingo mingo  1470 Nov 21 06:41 memtype.h
 -rw-r--r-- 1 mingo mingo  5003 Nov 21 06:41 memtype_interval.c
 -rw-r--r-- 1 mingo mingo 56668 Nov 21 06:41 set_memory.c

I named most of the files based on the API families they are 
implementing:

 - memtype*.c for the <asm/memtype.h> APIs
 - set_memory.c for the <asm/set_memory.h> APIs.

Is this close to what you had in mind?

 ( Note: cpa-test.c is a leftover that should probably be renamed to 
   set_memory_test.c, with a few explicit set_memory() API tests added as 
   well, not just the internal change_page_attribute() tests. )

I also started the process of tidying up the API namespace which is a bit 
of a historical accident as well, and I'm done with most of the memtype 
funtions, which are now:

            reserve_memtype()               => memtype_reserve()
            free_memtype()                  => memtype_free()
            kernel_map_sync_memtype()       => memtype_kernel_map_sync()
            io_reserve_memtype()            => memtype_reserve_io()
            io_free_memtype()               => memtype_free_io()

            memtype_check_insert()          => memtype_check_insert()
            memtype_erase()                 => memtype_erase()
            memtype_lookup()                => memtype_lookup()
            memtype_copy_nth_element()      => memtype_copy_nth_element()

This work is in WIP.x86/mm:

 git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/mm

 f53ee099dfac: x86/mm: Tabulate the page table encoding definitions
 2ab1a9a197f7: x86/mm/pat: Fix typo in the Kconfig help text
 0d2a9498e4db: x86/mm/pat: Clean up <asm/memtype.h> externs
 2e2ee215db87: x86/mm/pat: Rename <asm/pat.h> => <asm/memtype.h>
 84285e92bb7a: x86/mm/pat: Standardize on memtype_*() prefix for APIs
 b2c61e70ccca: x86/mm/pat: Move the memtype related files to arch/x86/mm/pat/
 f54b639ad101: x86/mm/pat: Clean up PAT initialization flags
 bca867e88012: x86/mm/pat: Harmonize 'struct memtype *' local variable and function parameter use
 35459848e92f: x86/mm/pat: Simplify the free_memtype() control flow
 a71fbb6061dc: x86/mm/pat: Create fixed width output in /sys/kernel/debug/x86/pat_memtype_list, similar to the E820 debug printouts
 a252a95b6b91: x86/mm/pat: Disambiguate PAT-disabled boot messages
 83d743db88c5: x86/mm/pat: Update the comments in pat.c and pat_interval.c and refresh the code a bit

 820cac65197c: x86/mm/pat: Rename pat_rbtree.c to pat_interval.c
 010ca1041da3: x86/mm/pat: Drop the rbt_ prefix from external memtype calls
 a2cb4c9af315: x86/mm/pat: Do not pass 'rb_root' down the memtype tree helper functions
 2418ac70a9c1: x86/mm/pat: Convert the PAT tree to a generic interval tree

But there's still quite some work left. I'll send out a series once I 
think the end result is a coherent whole.

Davidlohr's four patches are intended for v5.5, the remaining patches 
from me on top of his work will probably need a bit more testing.

Thanks,

	Ingo

  parent reply	other threads:[~2019-11-21 17:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 23:19 [PATCH -tip v2 0/4] x86,mm/pat: Move towards using generic interval tree Davidlohr Bueso
2019-10-21 23:19 ` [PATCH 1/4] x86/mm, pat: Convert pat tree to " Davidlohr Bueso
2019-11-20 18:05   ` Thomas Gleixner
2019-11-21 16:58     ` [PATCH] x86/mm/pat: Simplify the free_memtype() control flow Ingo Molnar
2019-11-21  6:03   ` [tip: x86/mm] x86/mm/pat: Convert the PAT tree to a generic interval tree tip-bot2 for Davidlohr Bueso
2019-10-21 23:19 ` [PATCH 2/4] x86,mm/pat: Cleanup some of the local memtype_rb_* calls Davidlohr Bueso
2019-11-20 18:06   ` Thomas Gleixner
2019-11-21  6:03   ` [tip: x86/mm] x86/mm/pat: Clean up some of the local memtype_rb_*() calls tip-bot2 for Davidlohr Bueso
2019-10-21 23:19 ` [PATCH 3/4] x86,mm/pat: Drop rbt suffix from external memtype calls Davidlohr Bueso
2019-11-20 18:07   ` Thomas Gleixner
2019-11-21  6:03   ` [tip: x86/mm] x86/mm/pat: Drop the rbt_ prefix from external memtype function names tip-bot2 for Davidlohr Bueso
2019-10-21 23:19 ` [PATCH 4/4] x86/mm, pat: Rename pat_rbtree.c to pat_interval.c Davidlohr Bueso
2019-11-19  8:17   ` Ingo Molnar
2019-11-19 17:16     ` Davidlohr Bueso
2019-11-21  6:03   ` [tip: x86/mm] x86/mm/pat: " tip-bot2 for Davidlohr Bueso
     [not found]     ` <CAHk-=wg565YQe6Dmpjg6QJ9aPHvkT7G60iDYS12TZoG+q+hbTw@mail.gmail.com>
2019-11-21 17:08       ` Ingo Molnar [this message]
2019-11-18 15:41 ` [PATCH -tip v2 0/4] x86,mm/pat: Move towards using generic interval tree Davidlohr Bueso
  -- strict thread matches above, loose matches on Subject: below --
2019-11-21  1:16 [PATCH 4/4] x86/mm, pat: Rename pat_rbtree.c to pat_interval.c Davidlohr Bueso
2019-11-21 16:42 ` [tip: x86/mm] x86/mm/pat: " tip-bot2 for Davidlohr Bueso
2019-11-21 17:55 ` tip-bot2 for Davidlohr Bueso

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=20191121170849.GB12042@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /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