Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761673Ab3DBQ17 (ORCPT ); Tue, 2 Apr 2013 12:27:59 -0400 Received: from li9-11.members.linode.com ([67.18.176.11]:58405 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757258Ab3DBQ15 (ORCPT ); Tue, 2 Apr 2013 12:27:57 -0400 Date: Tue, 2 Apr 2013 12:27:38 -0400 From: "Theodore Ts'o" To: Kent Overstreet Cc: linux-kernel@vger.kernel.org, linux-aio@kvack.org, akpm@linux-foundation.org, Zach Brown , Felipe Balbi , Greg Kroah-Hartman , Mark Fasheh , Joel Becker , Rusty Russell , Jens Axboe , Asai Thambi S P , Selvan Mani , Sam Bradshaw , Jeff Moyer , Al Viro , Benjamin LaHaise Subject: Re: [PATCH 23/33] generic dynamic per cpu refcounting Message-ID: <20130402162738.GG31577@thunk.org> Mail-Followup-To: Theodore Ts'o , Kent Overstreet , linux-kernel@vger.kernel.org, linux-aio@kvack.org, akpm@linux-foundation.org, Zach Brown , Felipe Balbi , Greg Kroah-Hartman , Mark Fasheh , Joel Becker , Rusty Russell , Jens Axboe , Asai Thambi S P , Selvan Mani , Sam Bradshaw , Jeff Moyer , Al Viro , Benjamin LaHaise References: <1363883754-27966-1-git-send-email-koverstreet@google.com> <1363883754-27966-24-git-send-email-koverstreet@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1363883754-27966-24-git-send-email-koverstreet@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 815 Lines: 21 Reviewed-by: "Theodore Ts'o" > + v = atomic64_add_return(1 + (1ULL << PCPU_COUNT_BITS), > + &ref->count); > + > + if (!(v >> PCPU_COUNT_BITS) && > + REF_STATUS(pcpu_count) == PCPU_REF_NONE && alloc) > + percpu_ref_alloc(ref, pcpu_count); This assumes that the kernel is compiled with -fno-strict-overflow. Which we do, and this is not the only place int the kernel where we depend on this, so while I was nervous before, I'm okay with it now. Could we at least have a comment saying that we're depending on -fno-strict-overflow, though? -- 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/