Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751580AbdI1VoS (ORCPT ); Thu, 28 Sep 2017 17:44:18 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:48625 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbdI1VoQ (ORCPT ); Thu, 28 Sep 2017 17:44:16 -0400 X-Google-Smtp-Source: AOwi7QCxDmth3X9QAnhSqq7wRGjYfb83AjX1aAQ4SdJlUaQqNJDdliNWr8yB3CPvMQjBYTvR48s/twkt4CY3vIHMRRs= MIME-Version: 1.0 In-Reply-To: <20170928144100.e11801ef742521e0e3f4b8df@linux-foundation.org> References: <1506543239-31470-1-git-send-email-axboe@kernel.dk> <1506543239-31470-11-git-send-email-axboe@kernel.dk> <20170928144100.e11801ef742521e0e3f4b8df@linux-foundation.org> From: Linus Torvalds Date: Thu, 28 Sep 2017 14:44:15 -0700 X-Google-Sender-Auth: KE3xZO861MQWXP1P315VoDPeZt8 Message-ID: Subject: Re: [PATCH 10/12] writeback: only allow one inflight and pending full flush To: Andrew Morton Cc: Jens Axboe , Linux Kernel Mailing List , linux-fsdevel , Johannes Weiner , Jan Kara Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 551 Lines: 15 On Thu, Sep 28, 2017 at 2:41 PM, Andrew Morton wrote: > > test_and_set_bit()? If there aren't any atomicity concerns (either because of higher-level locking, or because racing and having two people set the bit is fine), it can be better to do them separately if the test_bit() is the common case and you can avoid dirtying a cacheline that way. But yeah, if that is the case, it might be worth documenting, because test_and_set_bit() is the more obviously appropriate "there can be only one" model. Linus