Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754201AbeAKG6E (ORCPT + 1 other); Thu, 11 Jan 2018 01:58:04 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33169 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964AbeAKG6C (ORCPT ); Thu, 11 Jan 2018 01:58:02 -0500 X-Google-Smtp-Source: ACJfBouy9EfyF+anQbNaFelgFEZtuViuJY06VAcBTjiEH90tYYbz0zbU+l1uR+yFeB6mUd8TkanXoA== Date: Thu, 11 Jan 2018 15:57:57 +0900 From: Sergey Senozhatsky To: Dan Streetman Cc: Yu Zhao , Seth Jennings , Sergey Senozhatsky , Minchan Kim , Nitin Gupta , Andrew Morton , Linux-MM , linux-kernel Subject: Re: [PATCH] zswap: only save zswap header if zpool is shrinkable Message-ID: <20180111065757.GG494@jagdpanzerIV> References: <20180108225101.15790-1-yuzhao@google.com> <20180109224700.GA175231@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hello, Yu Zhao, Dan, sorry for the delay On (01/10/18 15:06), Dan Streetman wrote: [..] > Well, I think shrink vs evict an implementation detail, isn't it? > That is, from zswap's perspective, there should be: > > zpool_evictable() > if true, zswap needs to include the header on each compressed page, > because the zpool may callback zpool->ops->evict() which calls > zswap_writeback_entry() which expects the entry to start with a zswap > header. > if false, zswap doesn't need to include the header, because the zpool > will never, ever call zpool->ops->evict > > zpool_shrink() > this will try to shrink the zpool, using whatever > zpool-implementation-specific shrinking method. If zpool_evictable() > is true for this zpool, then zpool_shrink() *might* callback to > zpool->ops->evict(), although it doesn't have to if it can shrink > without evictions. If zpool_evictable() is false, then zpool_shrink() > will never callback to zpool->ops->evict(). ACK on this! -ss