Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3426669ybi; Mon, 29 Jul 2019 06:24:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHoKYL+SU00NOpewSjYmfrROhrsDEynChWcnRREW7XF85Gjaxf1GSJCLZ8OnD7S7iWx2xk X-Received: by 2002:a63:4612:: with SMTP id t18mr95584454pga.85.1564406660660; Mon, 29 Jul 2019 06:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564406660; cv=none; d=google.com; s=arc-20160816; b=vQ8odMg/WGhbFRJkdJOVvnzngv4m8KMckVTsvL+tplrBvmg+3B+tujYSXBm68Gg40B nZcTazrV4DsAqJ+40GYsbOOa03LcmptFiCVSoK0q1su8VwhjVbbE6UrsBFMAr4PEQzJB 15bv+oAbVoNfw0je/hzLyGJUrLZv2+KUyFIlE9YADh+ZE+OFAYWg6nqcAQsQDukeKAI1 2lF+uiS5Wd4ORNSv0xGb6K/xsyd0+l2uB0R9wuEoaS5FVDL8b60PGP2kTUaufwlFcfb2 bMl/hCpbqFgZSfnvSdLTGeMVtkTWJhOyuH5t7gQFEmN7kcBgx7qc6GxgWf88xsGE/ts4 3VOg== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=J8SecCHFAYNhISRn2gyDpuWW772w3hItu/yd4iRurZs=; b=uRafVTu8F5iEw1mUwvVAeM8El1uNoR9Any7WVFqSdlzg8ds13AYtURxkd9wsk741Rw jrVN9E9k2FNnDwzYJEVYRiZtXwybL3VACBvcwd/KJxcFa4osWeJWxjfPL/8guvsFGgpS eB/4ixHYHiyVe5sG/CIDBKn9PJkJNVSNOTYcHLxyahjFywD6I5a68Q15GeorgB4F63+W f4AePUCVQ6zz7JrkBK1PW4PGfAzXjq+RtchoqGLIF236A5XRYbBaQmhonWc+blrQold/ 4wxhNhse2YjoC/wyjwZ+GgRF6o5qKdGDS79RyDMTWp8FXWK8hrzGer6fSW6nkvZ7SGBD w6Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nfAVIyvw; 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 g12si28719956pgj.124.2019.07.29.06.24.05; Mon, 29 Jul 2019 06:24:20 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=nfAVIyvw; 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 S2387549AbfG2LHb (ORCPT + 99 others); Mon, 29 Jul 2019 07:07:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49774 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387469AbfG2LHa (ORCPT ); Mon, 29 Jul 2019 07:07:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=J8SecCHFAYNhISRn2gyDpuWW772w3hItu/yd4iRurZs=; b=nfAVIyvwOvu5mJxYbjzOPhZdx uugr83y7XKK1cjiO5jGGjHsCheAhouPpGABKL/0NlIFNBX/rvxEJlhTnOnuSVsat8iR6MBWyB6JUc QqAso2peSPdD8xVCuYdDlNN/ejrScq524Y8WsgGyJDtn9ImNR8qI0CQGZnqpf/r8uO9jPMnFfrJe+ XIZm006y2L5N5Dhn30XW2aXq9tS86Ct9jRgW1uiK4IrnjSmbZfedvuxrLGEAcYgFQYBMaoITo9Ztl yM6ZVEiwTE6BnTSErwTFei4lE0DPe6uv1eauzupGx2diDo5+dtXK19AihtiZ5m4P/ZyCGMzkfBJ72 DktEcOZfQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hs3V3-0005yc-UH; Mon, 29 Jul 2019 11:07:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A051A20B51713; Mon, 29 Jul 2019 13:07:27 +0200 (CEST) Date: Mon, 29 Jul 2019 13:07:27 +0200 From: Peter Zijlstra To: Mukesh Ojha Cc: mingo@redhat.com, will@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] locking/mutex: Use mutex flags macro instead of hard code value Message-ID: <20190729110727.GB31398@hirez.programming.kicks-ass.net> References: <1564397578-28423-1-git-send-email-mojha@codeaurora.org> <1564397578-28423-2-git-send-email-mojha@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1564397578-28423-2-git-send-email-mojha@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 29, 2019 at 04:22:58PM +0530, Mukesh Ojha wrote: > Let's use the mutex flag macro(which got moved from mutex.c > to linux/mutex.h in the last patch) instead of hard code > value which was used in __mutex_owner(). > > Signed-off-by: Mukesh Ojha > --- > include/linux/mutex.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/mutex.h b/include/linux/mutex.h > index 79b28be..c3833ba 100644 > --- a/include/linux/mutex.h > +++ b/include/linux/mutex.h > @@ -87,7 +87,7 @@ struct mutex { > */ > static inline struct task_struct *__mutex_owner(struct mutex *lock) > { > - return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07); > + return (struct task_struct *)(atomic_long_read(&lock->owner) & ~MUTEX_FLAGS); > } I would _much_ rather move __mutex_owner() out of line, you're exposing far too much stuff.