Received: by 10.223.164.221 with SMTP id h29csp79103wrb; Mon, 23 Oct 2017 18:28:14 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TIxzrmOnTURaB8DKR950WUDKfTbQYi5ryUK15kdw397Z1A+T13kxaokX3IEWoQCNwWY7GA X-Received: by 10.99.108.132 with SMTP id h126mr13140697pgc.434.1508808494745; Mon, 23 Oct 2017 18:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508808494; cv=none; d=google.com; s=arc-20160816; b=Y7NjIc0tQ2BAbrwTSU4YqMa90naMsufuwoUf5BwXLECDgTBhSb/zlWpjoccFIkz9jd JBm6gW8q0Oy3nlhttQB03orJcyWD/eiSgSi9IOPP4+mMi7Kis2QEljeV8qAd8JYxIGp9 0AKrcEPpcqj6LXFF9cgEbnvPpx798R3JMeH2yUH/2ilKvElGdDg7GHN6fYzyGISF0RBE aCz9ICo/41dG0ey9u9VRgXDLtUTmBJQs1EeiGyXvNbl7DkTGSF94NfI7ot2H7vwszYUK FaZK/J9Qs9S64ES7W2DJCjuUOzRnhe93jIwh7FFVwKbPO8ow7jqRChUe+iLjVwYMeRsI 0YhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=h1DZQG11rMFMgNNpNyFgY1IUDro/dHBu5k6L+VUSKLY=; b=N3LCzkHCvQA0savbT55+vgyQoLFvw9acHmDqO9HWwF4OvB/YLUwYPzbXGtlF0D67pg 3xDv65jC9M6dWJoE+GDqq0tUI0Dj5k5+wu84a4IKhWfGVwx2w7T5z6srfuHjqkrtUAP7 Z5w+MyxMlG1bSqQx2jz6zu2fdvuiDs2ZE25xLPNHreR7WvHJ4LvZ6fdB1LUhX46GPQBa iygzsmMkkB9TGYfcY8BeT/LvN3vJ1jo7WI7DXpLJBI2G6dmAHeVv8H0fZt5Bk5zOv+Ua uObzzAnAw7CyAX12TazflXyH6fkXgPPK0u/BEz/aJSSLxQ7rPjfrmzmN+8RuNFKzIxcZ pwkA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si5620705pgt.814.2017.10.23.18.28.01; Mon, 23 Oct 2017 18:28:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751407AbdJXB11 (ORCPT + 99 others); Mon, 23 Oct 2017 21:27:27 -0400 Received: from mga04.intel.com ([192.55.52.120]:56465 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbdJXB1Y (ORCPT ); Mon, 23 Oct 2017 21:27:24 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2017 18:27:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,424,1503385200"; d="scan'208";a="1209224220" Received: from kemi-desktop.sh.intel.com (HELO [10.239.13.103]) ([10.239.13.103]) by fmsmga001.fm.intel.com with ESMTP; 23 Oct 2017 18:27:21 -0700 Subject: Re: [PATCH] buffer: Avoid setting buffer bits that are already set To: Andi Kleen 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 References: <1508772444-27879-1-git-send-email-kemi.wang@intel.com> <87h8upxrvy.fsf@linux.intel.com> From: kemi Message-ID: <131ef377-7edb-738c-4ed1-debac7857434@intel.com> Date: Tue, 24 Oct 2017 09:25:44 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <87h8upxrvy.fsf@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017年10月24日 09:21, Andi Kleen wrote: > 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. > I meant to express the meaning of test before setting bit. Apologize to make you confused. > If you add special functions use a different variant that is only > atomic for the set. > > -Andi > From 1582099983404462782@xxx Tue Oct 24 01:22:00 +0000 2017 X-GM-THRID: 1582062716863867471 X-Gmail-Labels: Inbox,Category Forums