public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: kemi <kemi.wang@intel.com>, Andi Kleen <ak@linux.intel.com>
Cc: Jan Kara <jack@suse.cz>, Darrick J Wong <darrick.wong@oracle.com>,
	Eric Biggers <ebiggers@google.com>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	Jeff Layton <jlayton@redhat.com>,
	Dave <dave.hansen@linux.intel.com>,
	Andi Kleen <andi.kleen@intel.com>,
	Tim Chen <tim.c.chen@intel.com>,
	Ying Huang <ying.huang@intel.com>, Aaron Lu <aaron.lu@intel.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] buffer: Avoid setting buffer bits that are already set
Date: Tue, 24 Oct 2017 07:50:27 -0600	[thread overview]
Message-ID: <5677e6be-38ab-edb3-36db-094452c61d1e@kernel.dk> (raw)
In-Reply-To: <131ef377-7edb-738c-4ed1-debac7857434@intel.com>

On 10/23/2017 07:25 PM, kemi wrote:
> 
> 
> On 2017年10月24日 09:21, Andi Kleen wrote:
>> kemi <kemi.wang@intel.com> writes:
>>>
>>> I'll see if I can find some
>>>> time to implement the above in a nice way.
>>>
>>> Agree. Maybe something like test_and_set_bit() would be more suitable.
>>
>> test_and_set_bit is a very different operation for the CPU because
>> it is atomic for both. But we want the initial read to not
>> be atomic.
>>
> 
> I meant to express the meaning of test before setting bit.
> Apologize to make you confused.

That's why I suggested something like set_bit_if_not_set(),
test_and_set_bit() is both already used and has entirely
different semantics.

-- 
Jens Axboe

      reply	other threads:[~2017-10-24 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 15:27 [PATCH] buffer: Avoid setting buffer bits that are already set Kemi Wang
2017-10-23 16:19 ` Jens Axboe
2017-10-24  0:52   ` kemi
2017-10-24  1:21     ` Andi Kleen
2017-10-24  1:25       ` kemi
2017-10-24 13:50         ` Jens Axboe [this message]

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=5677e6be-38ab-edb3-36db-094452c61d1e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=aaron.lu@intel.com \
    --cc=agruenba@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=andi.kleen@intel.com \
    --cc=darrick.wong@oracle.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=ebiggers@google.com \
    --cc=jack@suse.cz \
    --cc=jlayton@redhat.com \
    --cc=kemi.wang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tim.c.chen@intel.com \
    --cc=ying.huang@intel.com \
    /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