public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
	Mateusz Guzik <mguzik@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH v2] kref: warn on uninitialized kref
Date: Mon, 19 May 2014 10:19:46 +0200	[thread overview]
Message-ID: <20140519081946.GV30445@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.LRH.2.02.1405171646290.32012@file01.intranet.prod.int.rdu2.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

On Sat, May 17, 2014 at 05:14:13PM -0400, Mikulas Patocka wrote:
> BTW. if we talk about performance - what about replacing:
> 
> 	if (atomic_dec_and_test(&variable)) {
> 		... release(object);
> 	}
> 
> with this:
> 
> 	if (atomic_read(&variable) == 1 || atomic_dec_and_test(&variable)) {
> 		barrier();
> 		... release(object);
> 	}

That would completely wreck kref_get_unless_zero().

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2014-05-19  8:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-17 10:49 [PATCH] target: fix memory leak on XCOPY Mikulas Patocka
2014-05-17 10:53 ` [PATCH] kref: warn on uninitialized kref Mikulas Patocka
2014-05-17 11:04   ` Mateusz Guzik
2014-05-17 12:36     ` Mikulas Patocka
2014-05-17 12:38     ` [PATCH v2] " Mikulas Patocka
2014-05-17 13:50       ` Bart Van Assche
2014-05-17 21:14         ` Mikulas Patocka
2014-05-18  7:17           ` Bart Van Assche
2014-05-19  8:19           ` Peter Zijlstra [this message]
2014-05-17 22:52 ` [PATCH] target: fix memory leak on XCOPY Nicholas A. Bellinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140519081946.GV30445@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bvanassche@acm.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mguzik@redhat.com \
    --cc=mingo@redhat.com \
    --cc=mpatocka@redhat.com \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox