From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AAECC43217 for ; Mon, 28 Nov 2022 10:03:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 681156B0072; Mon, 28 Nov 2022 05:03:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 631286B0073; Mon, 28 Nov 2022 05:03:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51FBD6B0074; Mon, 28 Nov 2022 05:03:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 442436B0072 for ; Mon, 28 Nov 2022 05:03:13 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1623F1C6509 for ; Mon, 28 Nov 2022 10:03:13 +0000 (UTC) X-FDA: 80182413066.22.3C815F4 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf22.hostedemail.com (Postfix) with ESMTP id 01038C0014 for ; Mon, 28 Nov 2022 10:03:10 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 49F6B1F891; Mon, 28 Nov 2022 10:03:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669629789; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MVQk/BC8lCkJeRKmi++rC4IIiaIxAziHE6qUrtUSs2g=; b=1H/1fQ9ZpRp2mOUC+LeZ3VzyZk1KSUC/1BI4v9DxgihhyquCwkiIY0OkgKTh7L72bzLnSL pXM+EbZW2dTSLU/b+mVFHvD/CdFP7wKcd0N0WyHa/6e3Lxxm3wpbf5xbqeLlr6zHZ1RFjT ORyZvgsRa0VOpybbrmaHFX4zJLBPJTU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669629789; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MVQk/BC8lCkJeRKmi++rC4IIiaIxAziHE6qUrtUSs2g=; b=DVaWYu1A2oNwc2j5ZO8/BXwt4hp/dqtL/YN/TqkFhedZE4GA70GNm5EoovKBLAiRhNmnbi Ts+1XOzp5LDse4AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 361BC1326E; Mon, 28 Nov 2022 10:03:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id VEY0DV2HhGMfEgAAMHmgww (envelope-from ); Mon, 28 Nov 2022 10:03:09 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 91205A070F; Mon, 28 Nov 2022 11:03:08 +0100 (CET) Date: Mon, 28 Nov 2022 11:03:08 +0100 From: Jan Kara To: Lukas Czerner Cc: Jan Kara , Hugh Dickins , Jan Kara , Eric Sandeen , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org Subject: Re: [PATCH v2 1/3] quota: add quota in-memory format support Message-ID: <20221128100308.rjqipq6kjjnlklim@quack3> References: <20221121142854.91109-1-lczerner@redhat.com> <20221121142854.91109-2-lczerner@redhat.com> <20221123170739.sugph5ixr7m3ejk6@quack3> <20221125093010.usb5ampqpthe5wae@fedora> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221125093010.usb5ampqpthe5wae@fedora> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669629791; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MVQk/BC8lCkJeRKmi++rC4IIiaIxAziHE6qUrtUSs2g=; b=C0KtyiLBJSbrYvKQthyFrH7DUYbRBgddj8WP+9VkrEU4nA/4v6OdkYMOEf/+pWCSRWXqIu jx+J4dXDyoBJ44f7Jpn/0J27mXU9fJWeRCFWpzIBRFeqwCMcjvsM32AEiKDeK7RQq6Ji/Y C8v2hvx2Ytps3/6KgLwWz+/5x3kQLdo= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="1H/1fQ9Z"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=DVaWYu1A; spf=pass (imf22.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669629791; a=rsa-sha256; cv=none; b=KCKor+6hWJSPkLfA4Ys7YnxkeOMdwXNdoDxNhFiJ2P2k34RUbmEHTfsxTC7LdkP9Xfegsl B/I2GCHhjbaZeN9IbBh8xtd3JCCdYP0g83JdZTqzPsDa7yqYMKnMjw18+YdhbVw5veC8El 1bHp8TvdWfFfTw0EAC4sExTG+V97VjY= X-Stat-Signature: w9xfo7zsceaqhxmbc4nakqsftph43a7e X-Rspam-User: X-Rspamd-Queue-Id: 01038C0014 X-Rspamd-Server: rspam11 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="1H/1fQ9Z"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=DVaWYu1A; spf=pass (imf22.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none X-HE-Tag: 1669629790-900886 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri 25-11-22 10:30:10, Lukas Czerner wrote: > On Wed, Nov 23, 2022 at 06:07:39PM +0100, Jan Kara wrote: > > On Mon 21-11-22 15:28:52, Lukas Czerner wrote: > > Instead of this I'd define: > > > > struct shmem_dquot { > > struct rb_node node; > > qid_t id; > > qsize_t bhardlimit; > > qsize_t bsoftlimit; > > qsize_t ihardlimit; > > qsize_t isoftlimit; > > }; > > > > It would be kept in rbtree like you do with quota_id but it will be also > > used as ultimate "persistent" storage of quota information when dquot gets > > reclaimed. We don't need to store grace times or usage information because > > if there is non-zero usage, dquot is referenced from the inode and thus > > cannot be reclaimed. > > Ok, this approach will duplicate the limits, but has advantage of having > much smaller footprint than entire dquot so in case we don't have any > usage in dquot we can safely reclaim it if needed without loosing user > provided limits. Probably a worthwhile trade-off. > > Or perhaps we can eliminate the duplicity when we store it in the tree on > ->destroy_dquot() and free it after we load the limits into dquot on > ->acquire_dquo(). We could but I don't think it's worth the hassle. In particular because ->release_dquot() must not fail (there's no simple way to recover from such failure). I don't say it is impossible to overcome but just not worth the saved memory IMHO. Honza -- Jan Kara SUSE Labs, CR