From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp134-25.sina.com.cn (smtp134-25.sina.com.cn [180.149.134.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D009F634 for ; Sat, 11 Jan 2025 23:45:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=180.149.134.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736639161; cv=none; b=IThRzajvUlX0mvE92n4KkdL5+6V3sPdqBnY/iEZBhgikXOKbbZ9aQPfXoat8QuxYfZMyf7qm87WYvKwVdTXNd1hUAr7oJ8C0pbvfDYVxmw8WvEN+Ft9t7SU5DNNSN/hkhFofROrzCf96QbqeRlGSmZ5OmxAsbxYF6g9n/hAMjGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736639161; c=relaxed/simple; bh=q4NYUCNiJ9ZHO4mvT7MqYqh9yk6WCQX7Q5vMiZd1hYU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=txc9TKbSbI6L2XnD2e7R3hkdz4gCFSJ1kF5JKgo1kkUZ4FxGdgRNaUDtl4+5IoDePxfJdYlHd7FmmeDWb+SOz9CSh9ry66GBLVJKlnNtBdk9O7bs4lp3/oYJi2u/RtQqaH5WSFwEsPGaprJExyZ4JT4yoRnfPLkgaztvm2SeMgw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=180.149.134.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.69.152]) by sina.com (10.185.250.21) with ESMTP id 6783028600004C1F; Sat, 12 Jan 2025 07:45:14 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 222563408369 X-SMAIL-UIID: 495635CB69394426804E48B2206A60CD-20250112-074514-1 From: Hillf Danton To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, peterz@infradead.org, willy@infradead.org, hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka Subject: Re: [PATCH v9 10/17] refcount: introduce __refcount_{add|inc}_not_zero_limited Date: Sun, 12 Jan 2025 07:44:59 +0800 Message-ID: <20250111234502.1739-1-hdanton@sina.com> In-Reply-To: References: <20250111042604.3230628-1-surenb@google.com> <20250111042604.3230628-11-surenb@google.com> <20250111063152.1638-1-hdanton@sina.com> <20250111121320.1656-1-hdanton@sina.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Sat, 11 Jan 2025 09:11:52 -0800 Suren Baghdasaryan > I see your point. I think it's a strong argument to use atomic > directly instead of refcount for this locking. I'll try that and see > how it looks. Thanks for the feedback! > Better not before having a clear answer to why is it sane to invent anything like rwsem in 2025. What, the 40 bytes? Nope it is the fair price paid for finer locking granuality. BTW Vlastimil, the cc list is cut down because I have to walk around the spam check on the mail agent side.