linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: Dave Hansen <dave.hansen@intel.com>,
	Michal Hocko <mhocko@suse.com>,
	akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm, sparse: drop pgdat_resize_lock in sparse_add/remove_one_section()
Date: Wed, 28 Nov 2018 09:17:11 +0000	[thread overview]
Message-ID: <20181128091711.ky7ub3kvkxvjq7ys@master> (raw)
In-Reply-To: <20181128084729.jozab2gaej5vh7ig@master>

On Wed, Nov 28, 2018 at 08:47:29AM +0000, Wei Yang wrote:
>>
>>Dave,
>>
>>Thanks for your comment :-)
>>
>>I should put more words to the reason for removing the lock.
>>
>>Here is a simplified call trace for sparse_add_one_section() during
>>physical add/remove phase.
>>
>>    __add_memory()
>>        add_memory_resource()
>>    	mem_hotplug_begin()
>>    
>>    	arch_add_memory()
>>    	    add_pages()
>>    	        __add_pages()
>>    	            __add_section()
>>    	                sparse_add_one_section(pfn)
>>    
>>    	mem_hotplug_done()
>>
>>When we just look at the sparse section initialization, we can see the
>>contention happens when __add_memory() try to add a same range or range
>>overlapped in SECTIONS_PER_ROOT number of sections. Otherwise, they
>>won't access the same memory. 
>>
>>If this happens, we may face two contentions:
>>
>>    * reallocation of mem_section[root]
>>    * reallocation of memmap and usemap
>>
>>While neither of them could be protected by the pgdat_resize_lock from
>>my understanding. Grab pgdat_resize_lock just slow down the process,
>>while finally they will replace the mem_section[root] and
>>ms->section_mem_map with their own new allocated data.
>>
>
>Hmm... sorry, I am not correct here.
>
>The pgdat_resize_lock do protect the second case.
>
>But not the first one.
>

One more thing, (hope I am not too talkative)

Expand the pgdat_resize_lock to include sparse_index_init() may not
work. Because SECTIONS_PER_ROOT number of section may span two nodes.


-- 
Wei Yang
Help you, Help me

  reply	other threads:[~2018-11-28  9:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27  2:36 Wei Yang
2018-11-27  6:25 ` Michal Hocko
2018-11-27  7:17   ` Dave Hansen
2018-11-27  7:30     ` Michal Hocko
2018-11-27  7:52     ` osalvador
2018-11-27  8:00       ` Michal Hocko
2018-11-27  8:18         ` osalvador
2018-11-28  0:29       ` Wei Yang
2018-11-28  8:19         ` Oscar Salvador
2018-11-28  8:41           ` Wei Yang
2018-11-28  1:01     ` Wei Yang
2018-11-28  8:47       ` Wei Yang
2018-11-28  9:17         ` Wei Yang [this message]
2018-11-28 12:34         ` Michal Hocko
2018-11-28  9:12 ` [PATCH v2] " Wei Yang
2018-11-28 10:28   ` David Hildenbrand
2018-11-29  8:54   ` Michal Hocko
2018-11-29  9:29     ` Wei Yang
2018-11-29 15:53   ` [PATCH v3 1/2] " Wei Yang
2018-11-29 15:53     ` [PATCH v3 2/2] mm, sparse: pass nid instead of pgdat to sparse_add_one_section() Wei Yang
2018-11-29 16:01       ` David Hildenbrand
2018-11-30  1:22         ` Wei Yang
2018-11-30  9:20           ` David Hildenbrand
2018-11-29 17:15       ` Michal Hocko
2018-11-29 23:57         ` Wei Yang
2018-11-29 16:06     ` [PATCH v3 1/2] mm, sparse: drop pgdat_resize_lock in sparse_add/remove_one_section() David Hildenbrand
2018-11-29 17:17       ` Michal Hocko
2018-11-30  4:28       ` Wei Yang
2018-11-30  9:19         ` David Hildenbrand
2018-11-30  9:52           ` Michal Hocko
2018-12-04  8:53             ` Wei Yang
2018-12-01  0:31           ` Wei Yang
2018-12-03 11:25         ` David Hildenbrand
2018-12-03 21:06           ` Wei Yang
2018-11-29 17:14     ` Michal Hocko
2018-12-04  8:56     ` [PATCH v4 " Wei Yang
2018-12-04  8:56       ` [PATCH v4 2/2] mm, sparse: pass nid instead of pgdat to sparse_add_one_section() Wei Yang
2018-12-04  9:24       ` [PATCH v4 1/2] mm, sparse: drop pgdat_resize_lock in sparse_add/remove_one_section() David Hildenbrand

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=20181128091711.ky7ub3kvkxvjq7ys@master \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.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