linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org,
	linux-hyperv@vger.kernel.org,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@kernel.org>,
	Oscar Salvador <osalvador@suse.de>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Baoquan He <bhe@redhat.com>, Wei Yang <richard.weiyang@gmail.com>
Subject: Re: [PATCH v2 5/8] hv_balloon: don't check for memhp_auto_online manually
Date: Tue, 17 Mar 2020 17:33:05 +0100	[thread overview]
Message-ID: <8e64674f-09df-3635-bb88-f55f6b7c73ab@redhat.com> (raw)
In-Reply-To: <877dzj3pyi.fsf@vitty.brq.redhat.com>

On 17.03.20 17:29, Vitaly Kuznetsov wrote:
> David Hildenbrand <david@redhat.com> writes:
> 
>> We get the MEM_ONLINE notifier call if memory is added right from the
>> kernel via add_memory() or later from user space.
>>
>> Let's get rid of the "ha_waiting" flag - the wait event has an inbuilt
>> mechanism (->done) for that. Initialize the wait event only once and
>> reinitialize before adding memory. Unconditionally call complete() and
>> wait_for_completion_timeout().
>>
>> If there are no waiters, complete() will only increment ->done - which
>> will be reset by reinit_completion(). If complete() has already been
>> called, wait_for_completion_timeout() will not wait.
>>
>> There is still the chance for a small race between concurrent
>> reinit_completion() and complete(). If complete() wins, we would not
>> wait - which is tolerable (and the race exists in current code as
>> well).
> 
> How can we see concurent reinit_completion() and complete()? Obvioulsy,
> we are not onlining new memory in kernel and hv_mem_hot_add() calls are
> serialized, we're waiting up to 5*HZ for the added block to come online
> before proceeding to the next one. Or do you mean we actually hit this
> 5*HZ timeout, proceeded to the next block and immediately after
> reinit_completion() we saw complete() for the previously added block?

Yes exactly - or if an admin manually offlines+re-onlines a random
memory block.

> This is tolerable indeed, we're making forward progress (and this all is
> 'best effort' anyway).

Exactly my thoughts.

[...]

> 
> Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> 

Thanks!

-- 
Thanks,

David / dhildenb


  reply	other threads:[~2020-03-17 16:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 10:49 [PATCH v2 0/8] mm/memory_hotplug: allow to specify a default online_type David Hildenbrand
2020-03-17 10:49 ` [PATCH v2 1/8] drivers/base/memory: rename MMOP_ONLINE_KEEP to MMOP_ONLINE David Hildenbrand
2020-03-17 10:49 ` [PATCH v2 2/8] drivers/base/memory: map MMOP_OFFLINE to 0 David Hildenbrand
2020-03-17 10:49 ` [PATCH v2 3/8] drivers/base/memory: store mapping between MMOP_* and string in an array David Hildenbrand
2020-03-17 10:49 ` [PATCH v2 4/8] powernv/memtrace: always online added memory blocks David Hildenbrand
2020-03-17 10:58   ` Michal Hocko
2020-03-17 22:04   ` Wei Yang
2020-03-19  9:49   ` Michael Ellerman
2020-03-17 10:49 ` [PATCH v2 5/8] hv_balloon: don't check for memhp_auto_online manually David Hildenbrand
2020-03-17 16:29   ` Vitaly Kuznetsov
2020-03-17 16:33     ` David Hildenbrand [this message]
2020-03-17 18:46   ` David Hildenbrand
2020-03-17 10:49 ` [PATCH v2 6/8] mm/memory_hotplug: unexport memhp_auto_online David Hildenbrand
2020-03-17 10:59   ` Michal Hocko
2020-03-17 22:24   ` Wei Yang
2020-03-17 10:49 ` [PATCH v2 7/8] mm/memory_hotplug: convert memhp_auto_online to store an online_type David Hildenbrand
2020-03-17 11:00   ` Michal Hocko
2020-03-17 10:49 ` [PATCH v2 8/8] mm/memory_hotplug: allow to specify a default online_type David Hildenbrand
2020-03-17 11:01   ` Michal Hocko
2020-03-17 11:05     ` David Hildenbrand
2020-03-17 11:08   ` David Hildenbrand
2020-03-18 13:05 ` [PATCH v2 0/8] " Baoquan He
2020-03-18 13:50   ` David Hildenbrand
2020-03-18 14:50     ` Baoquan He
2020-03-18 13:54   ` Michal Hocko
2020-03-18 14:41     ` Baoquan He
2020-03-18 13:58   ` Vitaly Kuznetsov
2020-03-18 14:41     ` Baoquan He
2020-03-18 15:00       ` Vitaly Kuznetsov

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=8e64674f-09df-3635-bb88-f55f6b7c73ab@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mhocko@kernel.org \
    --cc=osalvador@suse.de \
    --cc=rafael@kernel.org \
    --cc=richard.weiyang@gmail.com \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@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;
as well as URLs for NNTP newsgroup(s).