Re: [PATCHv5 1/8] zsmalloc: add to mm/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/25/2013 11:05 AM, Dan Magenheimer wrote:
>> From: Seth Jennings [mailto:sjenning@xxxxxxxxxxxxxxxxxx]
>> Sent: Friday, February 22, 2013 1:04 PM
>> To: Joonsoo Kim
>> Subject: Re: [PATCHv5 1/8] zsmalloc: add to mm/
>>
>> On 02/22/2013 03:24 AM, Joonsoo Kim wrote:
>>>
>>> It's my quick thought. So there is no concrete idea.
>>> As Seth said, with a FULL list, zsmalloc always access all zspage.
>>> So, if we want to know what pages are for zsmalloc, we can know it.
>>> The EMPTY list can be used for pool of zsmalloc itself. With it, we don't
>>> need to free zspage directly, we can keep zspages, so can reduce
>>> alloc/free overhead. But, I'm not sure whether it is useful.
>>
>> I think it's a good idea.  zswap actually does this "keeping some free
>> pages around for later allocations" outside zsmalloc in a mempool that
>> zswap manages.  Minchan once mentioned bringing that inside zsmalloc
>> and this would be a way we could do it.
> 
> I think it's a very bad idea.  If I understand, the suggestion will
> hide away some quantity (possibly a very large quantity) of pages
> for the sole purpose of zswap, in case zswap gets around to using them
> sometime in the future.  In the meantime, those pages are not available
> for use by any other kernel subsystems or by userland processes.
> An idle page is a wasted page.
> 
> While you might defend the mempool use for a handful of pages,
> frontswap writes/reads thousands of pages in a bursty way,
> and then can go idle for a very long time.  This may not be
> readily apparent with artificially-created memory pressure
> from kernbench with -jN (high N).  Leaving thousands
> of pages in zswap's personal free list may cause memory pressure
> that would otherwise never have existed.

I experimentally determined that this pool increased allocation
success rate and, therefore, reduced the number of pages going to the
swap device.

The zswap mempool has a target size of 256 pages.  This places an
upper bound on the number of pages held in reserve for zswap.  So we
aren't talking about "thousands of pages".

And yes, the pool does remove up to 1MB of memory (on a 4k PAGE_SIZE)
from general use, which causes the reclaim to start very slightly earlier.

> 
>> Just want to be clear that I'd be in favor of looking at this after
>> the merge.
> 
> I disagree... I think this is exactly the kind of fundamental
> MM interaction that should be well understood and resolved
> BEFORE anything gets merged.

While there is discussion to be had here, I don't agree that it's
"fundamental" and should not block merging.

The mempool does serve a purpose and adds measurable benefit. However,
if it is determined at some future time that having a reserved pool of
any size in zswap is bad practice, it can be removed trivially.

Thanks,
Seth

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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]