Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754125Ab0HISgz (ORCPT ); Mon, 9 Aug 2010 14:36:55 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:45824 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753910Ab0HISgy (ORCPT ); Mon, 9 Aug 2010 14:36:54 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=qsMUH04MegCe2Uyg3h/+dzvMvERVVFYFEqMJg9NShcds3Rmhdl0xvNmX0yVZveCuiL 3W616YROvLvvkvemGMHvL8rP8A7Mbcs6ZqPOHvCD2ZxZt9gMbc3Dn4E7+UCHJ4PYKkMJ OCVMy6UqYWTjqmIaroTLdKoyweGFOe+xvA4a4= MIME-Version: 1.0 In-Reply-To: <1281374816-904-3-git-send-email-ngupta@vflare.org> References: <1281374816-904-1-git-send-email-ngupta@vflare.org> <1281374816-904-3-git-send-email-ngupta@vflare.org> Date: Mon, 9 Aug 2010 21:36:53 +0300 X-Google-Sender-Auth: tEyuu-v76S8fhbeaLXTlZzqLvOs Message-ID: Subject: Re: [PATCH 02/10] Remove need for explicit device initialization From: Pekka Enberg To: Nitin Gupta Cc: Pekka Enberg , Minchan Kim , Andrew Morton , Greg KH , Linux Driver Project , linux-mm , linux-kernel Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1218 Lines: 26 On Mon, Aug 9, 2010 at 8:26 PM, Nitin Gupta wrote: > Currently, the user has to explicitly write a positive value to > initstate sysfs node before the device can be used. This event > triggers allocation of per-device metadata like memory pool, > table array and so on. > > We do not pre-initialize all zram devices since the 'table' array, > mapping disk blocks to compressed chunks, takes considerable amount > of memory (8 bytes per page). So, pre-initializing all devices will > be quite wasteful if only few or none of the devices are actually > used. > > This explicit device initialization from user is an odd requirement and > can be easily avoided. We now initialize the device when first write is > done to the device. > > Signed-off-by: Nitin Gupta AFAICT, most hardware block device drivers do things like this in the probe function. Why can't we do that for zram as well and drop the ->init_done and ->init_lock parts? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/