From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932270AbbBBEB1 (ORCPT ); Sun, 1 Feb 2015 23:01:27 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:48089 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754728AbbBBEB0 (ORCPT ); Sun, 1 Feb 2015 23:01:26 -0500 Date: Mon, 2 Feb 2015 13:01:24 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Sergey Senozhatsky , Andrew Morton , "linux-kernel@vger.kernel.org" , Linux-MM , Nitin Gupta , Jerome Marchand , Ganesh Mahendran Subject: Re: [PATCH v1 2/2] zram: remove init_lock in zram_make_request Message-ID: <20150202040124.GE6977@swordfish> References: <20150129022241.GA2555@swordfish> <20150129052827.GB25462@blaptop> <20150129060604.GC2555@swordfish> <20150129063505.GA32331@blaptop> <20150129070835.GD2555@swordfish> <20150130144145.GA2840@blaptop> <20150201145036.GA1290@swordfish> <20150202013028.GB6402@blaptop> <20150202014800.GA6977@swordfish> <20150202024405.GD6402@blaptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150202024405.GD6402@blaptop> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (02/02/15 11:44), Minchan Kim wrote: > > sure, I did think about this. and I actually didn't find any reason not > > to use ->refcount there. if user wants to reset the device, he first > > should umount it to make bdev->bd_holders check happy. and that's where > > IOs will be failed. so it makes sense to switch to ->refcount there, IMHO. > > If we use zram as block device itself(not a fs or swap) and open the > block device as !FMODE_EXCL, bd_holders will be void. > hm. I don't mind to use ->disksize there, but personally I'd maybe prefer to use ->refcount, which just looks less hacky. zram's most common use cases are coming from ram swap device or ram device with fs. so it looks a bit like we care about some corner case here. just my opinion, no objections against ->disksize != 0. I need to check fs/block_dev. can we switch away from ->bd_holders? > Another topic: As I didn't see enough fs/block_dev.c bd_holders in zram > would be mess. I guess we need to study hotplug of device and implement > it for zram reset rather than strange own konb. It should go TODO. :( ok, need to investigate this later. let's land current activities first. -ss