[PATCH 3/4] zswap: Zero-filled pages handling

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

 



On 17 August 2016 at 17:55, Pekka Enberg <penberg@xxxxxxxxxx> wrote:
> On Wed, Aug 17, 2016 at 1:18 PM, Srividya Desireddy
> <srividya.dr@xxxxxxxxxxx> wrote:
>> @@ -1314,6 +1347,13 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset,
>>         }
>>         spin_unlock(&tree->lock);
>>
>> +       if (entry->zeroflag) {
>> +               dst = kmap_atomic(page);
>> +               memset(dst, 0, PAGE_SIZE);
>> +               kunmap_atomic(dst);
>> +               goto freeentry;
>> +       }
>
> Don't we need the same thing in zswap_writeback_entry() for the
> ZSWAP_SWAPCACHE_NEW case?

Zero-filled pages are not compressed and stored in the zpool memory.
Zpool handle will not be created for zero-filled pages, hence they
can not be picked for eviction/writeback to the swap device.

- Srividya
>
>> +
>>         /* decompress */
>>         dlen = PAGE_SIZE;
>>         src = (u8 *)zpool_map_handle(entry->pool->zpool, entry->zhandle->handle,
>> @@ -1327,6 +1367,7 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset,
>>         zpool_unmap_handle(entry->pool->zpool, entry->zhandle->handle);
>>         BUG_ON(ret);
>
> - Pekka

[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]