From: David Hildenbrand <david@redhat.com>
To: Alexander Atanasov <alexander.atanasov@virtuozzo.com>,
Nadav Amit <nadav.amit@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
kernel@openvz.org,
Linux Virtualization <virtualization@lists.linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>
Subject: Re: RFC [PATCH v4 2/7] Enable balloon drivers to report inflated memory
Date: Tue, 11 Oct 2022 11:23:05 +0200 [thread overview]
Message-ID: <063efd58-8373-90ea-7c5e-9d0e9161d2ba@redhat.com> (raw)
In-Reply-To: <7ba328e5-3bc8-cb22-f00c-eddb8aea9a06@virtuozzo.com>
>>>> Sounds to me that all you want is some notifier to be called from
>>>> adjust_managed_page_count(). What am I missing?
>>>
>>> Notifier will act as an accumulator to report size of change and it will make things easier for the drivers and users wrt locking.
>>> Notifier is similar to the memory hotplug notifier.
>>
>> Overall, I am not convinced that there is any value of separating the value
>> and the notifier. You can batch both or not batch both. In addition, as I
>> mentioned, having two values seems racy.
>
> I have identified two users so far above - may be more to come.
> One type needs the value to adjust. Also having the value is necessary
> to report it to users and oom. There are options with callbacks and so
> on but it will complicate things with no real gain. You are right about
> the atomicity but i guess if that's a problem for some user it could
> find a way to ensure it. i am yet to find such place.
>
I haven't followed the whole discussion, but I just wanted to raise that
having a generic mechanism to notify on such changes could be valuable.
For example, virtio-mem also uses adjust_managed_page_count() and might
sometimes not trigger memory hotplug notifiers when adding more memory
(essentially, when it fake-adds memory part of an already added Linux
memory block).
What might make sense is schedule some kind of deferred notification on
adjust_managed_page_count() changes. This way, we could notify without
caring about locking and would naturally batch notifications.
adjust_managed_page_count() users would not require changes.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2022-10-11 9:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221005090158.2801592-1-alexander.atanasov@virtuozzo.com>
2022-10-05 9:01 ` [PATCH v4 1/7] Make place for common balloon code Alexander Atanasov
2022-10-05 9:01 ` [PATCH v4 2/7] Enable balloon drivers to report inflated memory Alexander Atanasov
2022-10-05 17:25 ` Nadav Amit
2022-10-06 7:34 ` Alexander Atanasov
2022-10-06 21:07 ` Nadav Amit
2022-10-07 10:58 ` RFC " Alexander Atanasov
2022-10-10 6:18 ` Nadav Amit
2022-10-10 7:24 ` Alexander Atanasov
2022-10-10 14:47 ` Nadav Amit
2022-10-11 9:07 ` Alexander Atanasov
2022-10-11 9:23 ` David Hildenbrand [this message]
2022-10-14 12:50 ` Alexander Atanasov
2022-10-14 13:01 ` David Hildenbrand
2022-10-14 13:33 ` Alexander Atanasov
2022-10-14 13:40 ` David Hildenbrand
2022-10-14 14:10 ` Alexander Atanasov
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=063efd58-8373-90ea-7c5e-9d0e9161d2ba@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.atanasov@virtuozzo.com \
--cc=kernel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mst@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=virtualization@lists.linux-foundation.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