From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753638AbbGKJq1 (ORCPT ); Sat, 11 Jul 2015 05:46:27 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:34561 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753374AbbGKJq0 (ORCPT ); Sat, 11 Jul 2015 05:46:26 -0400 From: Sergey Senozhatsky To: Minchan Kim Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: [PATCH 0/3] zsmalloc: small compaction improvements Date: Sat, 11 Jul 2015 18:45:29 +0900 Message-Id: <1436607932-7116-1-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.4.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, First two patches introduce new zsmalloc zs_pages_to_compact() symbol and change zram's `compact' sysfs attribute to be read-write: -- write triggers compaction, no changes -- read returns the number of pages that compaction can potentially free This lets user space to make a bit better decisions and to avoid unneeded (which will not result in any significant memory savings) compaction calls: Example: if [ `cat /sys/block/zram/compact` -gt 10 ]; then echo 1 > /sys/block/zram/compact; fi Up until now user space could not tell whether compaction will result in any gain. The third patch removes class locking around zs_can_compact() in zs_pages_to_compact(), the motivation and details are provided in the commit message. Sergey Senozhatsky (3): zsmalloc: factor out zs_pages_to_compact() zram: make compact a read-write sysfs node zsmalloc: do not take class lock in zs_pages_to_compact() Documentation/ABI/testing/sysfs-block-zram | 7 +++--- Documentation/blockdev/zram.txt | 4 +++- drivers/block/zram/zram_drv.c | 16 ++++++++++++- include/linux/zsmalloc.h | 1 + mm/zsmalloc.c | 37 +++++++++++++++++------------- 5 files changed, 44 insertions(+), 21 deletions(-) -- 2.4.5