From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbdA3Rhl (ORCPT ); Mon, 30 Jan 2017 12:37:41 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:11512 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbdA3Rhh (ORCPT ); Mon, 30 Jan 2017 12:37:37 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Sun, 29 Jan 2017 21:30:28 -0800 Date: Mon, 30 Jan 2017 09:35:34 -0800 From: Andy Ritger To: Sebastian Andrzej Siewior CC: Alex Goins , Thomas Gleixner , LKML , Subject: Re: [PATCH RT] Align rt_mutex inlining with upstream behavior Message-ID: <20170130173534.GA24966@prokofiev.nvidia.com> References: <1485312350-1265-1-git-send-email-agoins@nvidia.com> <20170126170109.6zhoohgodtvxot54@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170126170109.6zhoohgodtvxot54@linutronix.de> X-NVConfidentiality: public User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 26, 2017 at 06:01:09PM +0100, Sebastian Andrzej Siewior wrote: > On 2017-01-24 18:45:50 [-0800], Alex Goins wrote: > > mutex_destroy is no-op inline when DEBUG_MUTEX is not enabled. The RT Linux > > patches replace mutex_destroy() with rt_mutex_destroy(). This patch aligns > > rt_mutex_destroy() with mutex_destroy() by using the same no-op inline > > technique. > > > > Signed-off-by: Alex Goins > > Reviewed-by: Andy Ritger > > So what is the problem? Why are we doing this? There is still a check to > see if the lock is in use which is also done for the case where > DEBUG_MUTEX is disabled. The problem is that various static inline functions such as reservation_object_fini() indirectly call mutex_destroy. On DEBUG_MUTEX kernels, mutex_destroy is EXPORT_SYMBOL_GPL. In upstream, non-DEBUG_MUTEX kernels define mutex_destroy to a noop. This gives users the option of disabling DEBUG_MUTEX if they want to use non-GPL, reservation_object_fini()-using, kernel modules. In PREEMPTRT, non-DEBUG_MUTEX kernels export rt_mutex_destroy as EXPORT_SYMBOL_GPL, so users no longer have the work around of using DEBUG_MUTEX. This patch gives PREEMPTRT users the option of disabling DEBUG_MUTEX if they want to use such kernel modules, matching upstream behavior.