linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave@sr71.net>
To: Anshuman Khandual <khandual@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Cc: hch@lst.de, akpm@linux-foundation.org, dan.j.williams@intel.com,
	linux-mm@kvack.org
Subject: Re: [PATCH] proc: mm: export PTE sizes directly in smaps (v2)
Date: Mon, 28 Nov 2016 09:00:10 -0800	[thread overview]
Message-ID: <4e792e57-c34c-1609-f637-33cf3b136851@sr71.net> (raw)
In-Reply-To: <5837B774.6060604@linux.vnet.ibm.com>

On 11/24/2016 08:00 PM, Anshuman Khandual wrote:
...
>> The current mechanisms work fine when we have one or two page sizes.
>> But, they start to get a bit muddled when we mix page sizes inside
>> one VMA.  For instance, the DAX folks were proposing adding a set of
>> fields like:
> 
> So DAX is only case which creates this scenario of multi page sizes in
> the same VMA ? Is there any cases other than DAX mapping ?

Both file and anonymous huge pages.  No other ones in the core VM that I
can think of.

>> 	DevicePages:
>> 	DeviceHugePages:
>> 	DeviceGiganticPages:
>> 	DeviceGinormousPages:
> 
> I guess these are the page sizes supported at PTE, PMD, PUD, PGD level.
> Are all these page sizes supported right now or we are just creating
> place holder for future.

I know there are patches for PUD level support in DAX, but I don't think
they're merged yet.  There is definitely *not* support for PGD level
since we don't have such support in hardware on x86 as far as I know.

>> SwapPss:               0 kB
>> KernelPageSize:        4 kB
>> MMUPageSize:           4 kB
>> Locked:                0 kB
>> Ptes@4kB:	      32 kB
>> Ptes@2MB:	    2048 kB
> 
> So in the left column we are explicitly indicating the size of the PTE
> and expect the user to figure out where it can really be either at PTE,
> PMD, PUD etc. Thats little bit different that 'AnonHugePages' or the
> Shared_HugeTLB/Private_HugeTLB pages which we know are the the PMD/PUD
> level.

Yeah, it's a little different from what we have.

>> The format I used here should be unlikely to break smaps parsers
>> unless they're looking for "kB" and now match the 'Ptes@4kB' instead
>> of the one at the end of the line.
> 
> Right. So you are dropping the idea to introduce these fields as you
> mentioned before for DAX mappings.
> 
>  	DevicePages:
>  	DeviceHugePages:
>  	DeviceGiganticPages:
>  	DeviceGinormousPages:

Right.  We don't need those if we have this patch.

>>  	if (page) {
>>  		int mapcount = page_mapcount(page);
>> +		unsigned long hpage_size = huge_page_size(hstate_vma(vma));
>>
>> +		mss->rss_pud += hpage_size;
>>  		if (mapcount >= 2)
>> -			mss->shared_hugetlb += huge_page_size(hstate_vma(vma));
>> +			mss->shared_hugetlb += hpage_size;
>>  		else
>> -			mss->private_hugetlb += huge_page_size(hstate_vma(vma));
>> +			mss->private_hugetlb += hpage_size;
>>  	}
>>  	return 0;
> 
> Hmm, is this related to these new changes ? The replacement of 'hpage_size'
> instead of huge_page_size(hstate_vma(vma)) can be done in a separate patch.

Yes, this is theoretically unrelated, but I'm not breaking this 3-line
change up into a different patch unless there's a pretty good reason reason.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2016-11-28 17:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17  0:28 Dave Hansen
2016-11-24 14:22 ` Vlastimil Babka
2016-11-28 16:52   ` Dave Hansen
2016-11-28 21:07     ` Vlastimil Babka
2016-11-28 21:39       ` Dave Hansen
2016-11-29  8:01         ` Vlastimil Babka
2016-11-29 15:07         ` Catalin Marinas
2016-11-25  4:00 ` Anshuman Khandual
2016-11-28 17:00   ` Dave Hansen [this message]

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=4e792e57-c34c-1609-f637-33cf3b136851@sr71.net \
    --to=dave@sr71.net \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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