From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbdJXBVX (ORCPT ); Mon, 23 Oct 2017 21:21:23 -0400 Received: from mga11.intel.com ([192.55.52.93]:39762 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbdJXBVW (ORCPT ); Mon, 23 Oct 2017 21:21:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,424,1503385200"; d="scan'208";a="1234384071" From: Andi Kleen To: kemi Cc: Jens Axboe , Jan Kara , Darrick J Wong , Eric Biggers , Andreas Gruenbacher , Jeff Layton , Dave , Andi Kleen , Tim Chen , Ying Huang , Aaron Lu , Linux Kernel Subject: Re: [PATCH] buffer: Avoid setting buffer bits that are already set References: <1508772444-27879-1-git-send-email-kemi.wang@intel.com> Date: Mon, 23 Oct 2017 18:21:21 -0700 In-Reply-To: (kemi's message of "Tue, 24 Oct 2017 08:52:22 +0800") Message-ID: <87h8upxrvy.fsf@linux.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kemi 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. If you add special functions use a different variant that is only atomic for the set. -Andi