Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751858AbdFZCXN (ORCPT ); Sun, 25 Jun 2017 22:23:13 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:43742 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474AbdFZCXE (ORCPT ); Sun, 25 Jun 2017 22:23:04 -0400 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.220.163 X-Original-MAILFROM: minchan@kernel.org Date: Mon, 26 Jun 2017 11:23:01 +0900 From: Minchan Kim To: kerolasa@gmail.com Cc: Sergey Senozhatsky , Nitin Gupta , linux-kernel@vger.kernel.org, util-linux Subject: Re: zram hot_add device busy Message-ID: <20170626022301.GA18490@bbox> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1674 Lines: 49 Hello, On Sat, Jun 24, 2017 at 11:08:01AM +0100, Sami Kerola wrote: > Hello, > > While going through if there are new util-linux bugs reported I came a > cross this https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1645846 > > Simple way to reproduce the issue is: > d=$(cat /sys/class/zram-control/hot_add) && zramctl --size 256M /dev/zram$d To know the problem comes from any side, could you test it without zramctl command? IOW, d=$(cat /sys/class/zram-control/hot_add) && echo $((256<<20)) /dev/zram$d If it still has a problem, please show your test code which helps understanding of fundamental problem a lot. ;-) > > I am not entirely sure, but drivers/block/zram/zram_drv.c function > zram_add() should block until the device is usable. Looking the code > that it might be the device_add_disk() from block/genhd.c that should > do the blocking. But perhaps it's best if I leave such detail to > people who know the code a bit better. I might miss something but I believe device is usable state after zram_add done. Just in case, please test return value after some operation. if [ $? -ne 0 ]; then echo "fail to some op" blah blah fi Thanks. > > One thing annoys me. I expected 'zramctl --find --size 256M' to suffer > from same issue but it does not. I can only reproduce the issue when > triggering hot_add separately, and as quick as possibly using the > path. Notice that sometimes it takes second try before the hot_add and > use triggers the issue. That is almost certainly down to speed the > system in hand, e.g., quicker the computer less likely to trigger. > > -- > Sami Kerola > http://www.iki.fi/kerolasa/