Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp633864ybh; Sat, 3 Aug 2019 06:38:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyViI8twuhnFuY+/X/89Sg1nPUOJnoAupzc7s3rBe6eeqEadZVa9d3wLRI0lJXr1OyKgArE X-Received: by 2002:a63:ec03:: with SMTP id j3mr27457563pgh.325.1564839530383; Sat, 03 Aug 2019 06:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564839530; cv=none; d=google.com; s=arc-20160816; b=CExBHSzdAanHH759ZEIOrTYQlxKDIw6FGw2HDA1Loe38G4X13cNqB/PKHkC9E96t6U MC1g5uzgAaW5SjeHg3UNAvFPW/xdkPab5YjXXnCC0Qp+9IMEPqV6tfc0QiCm8208Rk/t lyjdSXvqRHnIy0kjy5e5oephOHxgAgPNL8f1XP7SNr7rnAuLk9h50TaMNIzhaQIWhWFK XBFkMjnjw8vw4Mvbr0LLshSRrrm8FcUxASiE6hNQa5GGB80CILb4ldyxBhXE9t+J1AqF LKabhRDuaQV5l1Kc8hKghzXYWJrbYbiBi6xT5plyyHHJmJQ0cWxfjtam/2y/PBZkqP8w F+vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JnFIxOkpNcZYRay8DKQqQvnlT+t5tL3INkAqh/eYj7U=; b=iOy7yVtVzki+m0xGDJz1bTgElGx5zxVsijwV1LRG5wl2IXHiaRZ77n1+lvD/n57FZg HRh8X0CzXMNHg/TgIy8SwldXuBdfkIoUyjl8ucM081CYilBrjecdneY2vwayx+aauRHi uaZv/w94yTnDhJtRMSrZ7GMlw6EOYXxpA1QNY1UTylrp2oZWYRuazfN8UJ+zKsoQkRiZ 3D+Nx1XWErexjUJayoQKAhgxRGUsFj4ROZUvIljab1g8xPMgl09Ahne/uME7uZLpc6gA ye8IGEtkJIeqPFB9yPsvDpFl9U+fqDteaYJW86NX3W+zAzgUtnomE5b96Pen5inP0r5c 7EVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LwXMEarF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cl13si36739413plb.97.2019.08.03.06.38.21; Sat, 03 Aug 2019 06:38:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LwXMEarF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436526AbfHBNkc (ORCPT + 99 others); Fri, 2 Aug 2019 09:40:32 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:40830 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406490AbfHBNkc (ORCPT ); Fri, 2 Aug 2019 09:40:32 -0400 Received: by mail-yb1-f196.google.com with SMTP id j6so4701068ybm.7 for ; Fri, 02 Aug 2019 06:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JnFIxOkpNcZYRay8DKQqQvnlT+t5tL3INkAqh/eYj7U=; b=LwXMEarFcR4Bs/zcWuQ8IJ1fnw5GW8qi7QewqVHSgPtxEMZwFnr70Ww/mfO4fsGMsU vst2cS60sOBdSWQ+ahzOfd/EX0Huk7RSVXUTyR8jJOCema3fcTbIDC91OAE6uQ60jKCN saJRbOOu7t1+twXuZQZ8kdVtoPj5THrS0dZJxlToQ8jPfXwRW5zvJ4gZ1AAfLuvZjwCL 5Qe6KtgL2vlpQArknto3oiIGXhIDYndqcmwZyWnEs0tAcA3ggoyZDmj/qd41TDwHBY23 fI0R+qIRrWZjaTFDaECoRlkYW3rHOyH68XzDzTagRens4oc9AUXKOAaMZt09TJ2yfIx0 ofWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JnFIxOkpNcZYRay8DKQqQvnlT+t5tL3INkAqh/eYj7U=; b=Ln9Ekzhxmqzm8gLdfsNcu51wCkFkOlG+A+AwObYUb8wz1DlviDLs0TZgrjsHGzJ6Na 4AFsSccZbu+rbt/5w7VqSoyfT3ESSbEcYVUNv9kt57ZsWwTll+dfGbrcNqZzdosRuJBW WlzS16X6do9/f/RRVvHuD1KUMfqqf9cQ01q3VKKD1wB5WxS0C5xJthG4LXU5GSm6XEmX KN+pKetlaxtqkvq6RmYsfS8LxkMKIdN+G/IW70CHmndt3a97ifNZTXTwEh5XgA2qvQ15 xzutSuIADl2iW74COuP+DdLXFFTJ+63QKemoATIdsLvlMWYh+GeW8ELPPBKCT7DeJZVP dkzg== X-Gm-Message-State: APjAAAU9+FoizOdrCrH2Jgp5tEjKZYnUgjmdjMZRZ8MdVVWCX2M6BM/C Kn8kBHltLz/D18n32rlifTXIaI3S X-Received: by 2002:a25:338b:: with SMTP id z133mr82353257ybz.85.1564753230287; Fri, 02 Aug 2019 06:40:30 -0700 (PDT) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com. [209.85.219.179]) by smtp.gmail.com with ESMTPSA id k64sm17138045ywk.77.2019.08.02.06.40.28 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 02 Aug 2019 06:40:28 -0700 (PDT) Received: by mail-yb1-f179.google.com with SMTP id a5so26866857ybo.13 for ; Fri, 02 Aug 2019 06:40:28 -0700 (PDT) X-Received: by 2002:a25:5e44:: with SMTP id s65mr77950006ybb.235.1564753227994; Fri, 02 Aug 2019 06:40:27 -0700 (PDT) MIME-Version: 1.0 References: <20190802083541.12602-1-hslester96@gmail.com> In-Reply-To: <20190802083541.12602-1-hslester96@gmail.com> From: Willem de Bruijn Date: Fri, 2 Aug 2019 09:39:51 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] cxgb4: sched: Use refcount_t for refcount To: Chuhong Yuan Cc: Vishal Kulkarni , "David S . Miller" , Network Development , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 2, 2019 at 4:36 AM Chuhong Yuan wrote: > > refcount_t is better for reference counters since its > implementation can prevent overflows. > So convert atomic_t ref counters to refcount_t. > > Signed-off-by: Chuhong Yuan > --- > Changes in v2: > - Convert refcount from 0-base to 1-base. This changes the initial value from 0 to 1, but does not change the release condition. So this introduces an accounting bug?