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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFBEBC4332F for ; Mon, 18 Oct 2021 15:42:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C852760F8F for ; Mon, 18 Oct 2021 15:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233343AbhJRPo2 (ORCPT ); Mon, 18 Oct 2021 11:44:28 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:37076 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233233AbhJRPo1 (ORCPT ); Mon, 18 Oct 2021 11:44:27 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]:46662) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mcUmD-008WoB-Kb; Mon, 18 Oct 2021 09:42:13 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95]:40538 helo=email.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mcUmC-00D1TG-KO; Mon, 18 Oct 2021 09:42:13 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Yu Zhao Cc: Alexey Gladkov , Rune Kleveland , Jordan Glover , LKML , Linux-MM , "containers\@lists.linux-foundation.org" References: <878rzw77i3.fsf@disp2133> <20210929173611.fo5traia77o63gpw@example.org> <20210930130640.wudkpmn3cmah2cjz@example.org> <878rz8wwb6.fsf@disp2133> <87v92cvhbf.fsf@disp2133> <87mtnavszx.fsf_-_@disp2133> <20211015230922.7s7ab37k2sioa5vg@example.org> <87zgr8vpop.fsf@disp2133> Date: Mon, 18 Oct 2021 10:35:12 -0500 In-Reply-To: (Yu Zhao's message of "Sun, 17 Oct 2021 13:35:37 -0600") Message-ID: <8735oyuz0v.fsf@disp2133> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1mcUmC-00D1TG-KO;;;mid=<8735oyuz0v.fsf@disp2133>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19IRU+fje8+4Jcix4fh8vbtCkuc+2VVzC0= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [CFT][PATCH] ucounts: Fix signal ucount refcounting X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yu Zhao writes: > On Sat, Oct 16, 2021 at 11:35 AM Eric W. Biederman > wrote: >> >> Alexey Gladkov writes: >> >> > On Fri, Oct 15, 2021 at 05:10:58PM -0500, Eric W. Biederman wrote: >> >> + goto dec_unwind; >> >> + } >> >> + return ret; >> >> +dec_unwind: >> >> + dec = atomic_long_add_return(1, &iter->ucount[type]); >> > >> > Should be -1 ? >> >> Yes it should. I will fix and resend. > > Or just atomic_long_dec_return(). It would have to be atomic_long_sub_return(). Even then I would want to change all of kernel/ucount.c to use the same helper function so discrepancies can easily be spotted. It is a good idea, just not I think for this particular patch. Eric