svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon

Attilio Rao attilio at freebsd.org
Wed Jun 25 15:03:33 UTC 2014


On Wed, Jun 25, 2014 at 4:06 PM, Roger Pau Monné <royger at freebsd.org> wrote:
> On 25/06/14 15:44, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monné <royger at freebsd.org> wrote:
>>> On 25/06/14 13:58, Attilio Rao wrote:
>>>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné <royger at freebsd.org> wrote:
>>>>> Author: royger
>>>>> Date: Wed Jun 25 09:51:08 2014
>>>>> New Revision: 267858
>>>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>>>
>>>>> Log:
>>>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>>>
>>>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>>>   wired. This prevents them from increasing the system wired page count,
>>>>>   which can lead to mlock failing because of hitting the limit in
>>>>>   vm.max_wired.
>>>>
>>>> This change is conceptually wrong.
>>>> The pages balloon is allocating are unmanaged and they should be wired
>>>> by definition. Alan and I are considering enforcing this (mandatory
>>>> wired pages for unmanaged pages allocation) directly in the KPI.
>>>> This in practice just seem an artifact to deal with scarce  wired
>>>> memory limit. I suggest that for the XEN case this limit gets bumped
>>>> rather relying on similar type of hacks.
>>>
>>> IMHO, marking them as wired seems wrong too, those pages are not wired,
>>> they are simply not there any more. This was discussed in:
>>
>> I'm not entirely sure what do you mean with "not there anymore", so
>> I'm just guessing and I assume that you mean "pages are not collected
>> in any vm object and then they are not referenced in any pagequeue".
>> By extension this also matches what "unmanaged page" means.
>>
>> If the page is unmanaged it means that the pagedaemon won't see it, so
>> they won't be swapped out anyway. Wiring them it will enforce more
>> sanity checking on the page. The max_wired concern may be real,
>> however, please see below.
>
> What I meant by "not there" is that the physical addresses associated
> with the pages are no longer valid (it's a hole in the physical memory
> map). To me it seems conceptually wrong to account those pages as wired.

They are not. They are at all effect wired (even if with a slightly
different semantic), meaning wired as also not-pageable. The fact that
you won't mark them wired will just weaken the accounting,
debuggability and tracing side.

> Thinking from a user point of view for example, if I'm inside of a VM
> that has ballooned down, I will see a huge amount of memory marked as
> wired on the top utility, which seems wrong, those pages are simply not
> there anymore, and as so, they shouldn't show up in stats.
>
> It also makes it really hard to know which memory is really wired and in
> use by the system, as opposed to the wired memory used by the balloon
> driver.

I think this is really the problem with your approach. Now memory will
not be reachable by the pagedaemon and yet you won't see it showing up
anywhere. Memory leaks could go unnoticed, to some extent. I don't
think that's really what you want.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the svn-src-all mailing list