Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp751605ybx; Wed, 30 Oct 2019 04:33:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLO0n2lSXcZNkk2gzWKk3GN9Gsu0KR3ODTQxYOkCagJbKYyxxufCJacotKcgQGTqKJ0URT X-Received: by 2002:a50:9713:: with SMTP id c19mr31366286edb.206.1572435234661; Wed, 30 Oct 2019 04:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572435234; cv=none; d=google.com; s=arc-20160816; b=yiP41WQDTAsuqT4b311UKyc95mabjtjAT+iNjLxR8NG1Iid1hzb5vO9fL/dVynRC+q Zw53OJiAM4K0axiWQ0UiUeiEMp0CTCofr71uHLnolPeemnBQCSfCnQGqb709YbaZLJ2x YHUqWw5TG2X/eVl/mTlJZzwZQg79ogUR6RJUiaXtxhZgfSosuZAsho/VLrNQVwV588T9 JfX7w48mOnvGPOP87uFEimxHbsw/MUtlPnLJzsUSPafxtmf3TFOs67OFI4w7DSKbBqGn r9ls6NTZiUv6/riBXUgEZaBEFm34wWpIAM6GZG3IwsJ+HYVFNRuyhCgmT8Q5Cmp0Lc4j 7QVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=VhoHYGZgJkdytWQ7D2NcalgQlWHmUC8o6nNob/ETzYY=; b=oxWTAUfGhQIswrKiMOw2462XxjYwBEhZZdoLA3cIvCzwQ8W7qAQcsRfNhmMPX+zp/O Ucc0kcG17YEXa8znc2m+63XRRMoHq1ROQa2RBnkDg3TtVPvqBR0zOx0ESM67Uvkjg01w LfgsWk04pWJ3emDXXqitc+eyS+qzi6bUB7ui2K42P5MhCan1Ynap4k0WIKQNmNmqPsVj 50UZIO8RNbyt6TINZeca1Z5KJvhWIycaQyi3LGXIHJlzoPyHOiFJk/ZjAWT3FSHiT4nF Qzihom6jUjUJM7gKL3S9s/jXFlXzzfLV/K/nqkge/FNuWygLkKfPsoOrpNfKFo2OLHDr Djgw== 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 qx10si1122895ejb.27.2019.10.30.04.33.28; Wed, 30 Oct 2019 04:33:54 -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 S1726184AbfJ3Lcp (ORCPT + 99 others); Wed, 30 Oct 2019 07:32:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:52112 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726065AbfJ3Lcp (ORCPT ); Wed, 30 Oct 2019 07:32:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C0F22ACD8; Wed, 30 Oct 2019 11:32:42 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 3A5A5DA783; Wed, 30 Oct 2019 12:32:52 +0100 (CET) Date: Wed, 30 Oct 2019 12:32:52 +0100 From: David Sterba To: Davidlohr Bueso Cc: dsterba@suse.com, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH] fs/affs: Replace binary semaphores with mutexes Message-ID: <20191030113252.GD3001@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Davidlohr Bueso , dsterba@suse.com, linux-kernel@vger.kernel.org, Davidlohr Bueso References: <20191027220143.10756-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191027220143.10756-1-dave@stgolabs.net> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 27, 2019 at 03:01:43PM -0700, Davidlohr Bueso wrote: > At a slight footprint cost (24 vs 32 bytes), mutexes are more optimal > than semaphores; it's also a nicer interface for mutual exclusion, > which is why they are encouraged over binary semaphores, when possible. > > For both i_link_lock and i_ext_lock (and hence i_hash_lock which I > annotated for the hash lock mapping hackery for lockdep), their semantics > imply traditional lock ownership; that is, the lock owner is the same for > both lock/unlock operations and does not run in irq context. Therefore > it is safe to convert. > > Signed-off-by: Davidlohr Bueso Thanks, I'll add it to affs queue.