From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751736AbdJ2BVK (ORCPT ); Sat, 28 Oct 2017 21:21:10 -0400 Received: from [45.249.212.32] ([45.249.212.32]:60897 "EHLO huawei.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751445AbdJ2BVJ (ORCPT ); Sat, 28 Oct 2017 21:21:09 -0400 Message-ID: <59F52CC1.6010504@huawei.com> Date: Sun, 29 Oct 2017 09:20:01 +0800 From: zhouchengming User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Zhou Chengming CC: , , , , , , , , , , , Subject: Re: [PATCH 2/4] x86/alternatives: Don't need text_mutex when text_poke() on UP References: <1509195057-117316-1-git-send-email-zhouchengming1@huawei.com> <1509195057-117316-2-git-send-email-zhouchengming1@huawei.com> In-Reply-To: <1509195057-117316-2-git-send-email-zhouchengming1@huawei.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.236.183] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oops, this is very wrong. Please ignore this patchset. Sorry for the noise... Thanks! On 2017/10/28 20:50, Zhou Chengming wrote: > The alternatives_smp_lock/unlock only be used on UP, so we don't > need to hold the text_mutex when text_poke(). Then in the next patch, > we can remove the outside smp_alt mutex too. > > Signed-off-by: Zhou Chengming > --- > arch/x86/kernel/alternative.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c > index 8549269..5c3f593 100644 > --- a/arch/x86/kernel/alternative.c > +++ b/arch/x86/kernel/alternative.c > @@ -442,7 +442,6 @@ static void alternatives_smp_lock(const s32 *start, const s32 *end, > { > const s32 *poff; > > - mutex_lock(&text_mutex); > for (poff = start; poff< end; poff++) { > u8 *ptr = (u8 *)poff + *poff; > > @@ -452,7 +451,6 @@ static void alternatives_smp_lock(const s32 *start, const s32 *end, > if (*ptr == 0x3e) > text_poke(ptr, ((unsigned char []){0xf0}), 1); > } > - mutex_unlock(&text_mutex); > } > > static void alternatives_smp_unlock(const s32 *start, const s32 *end, > @@ -460,7 +458,6 @@ static void alternatives_smp_unlock(const s32 *start, const s32 *end, > { > const s32 *poff; > > - mutex_lock(&text_mutex); > for (poff = start; poff< end; poff++) { > u8 *ptr = (u8 *)poff + *poff; > > @@ -470,7 +467,6 @@ static void alternatives_smp_unlock(const s32 *start, const s32 *end, > if (*ptr == 0xf0) > text_poke(ptr, ((unsigned char []){0x3E}), 1); > } > - mutex_unlock(&text_mutex); > } > > struct smp_alt_module {