Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751111AbdL3Upm (ORCPT ); Sat, 30 Dec 2017 15:45:42 -0500 Received: from mail-it0-f47.google.com ([209.85.214.47]:35961 "EHLO mail-it0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbdL3Upl (ORCPT ); Sat, 30 Dec 2017 15:45:41 -0500 X-Google-Smtp-Source: ACJfBougn79qE5XVsbsr1dx8qnGODY/OnQo9NjlA9Ly2njCILrCkRgjguGFkVLqFX3c8arKGwEy4RbJhBn/gThn2h5s= MIME-Version: 1.0 In-Reply-To: References: <20171230132927.GA2731@light.dominikbrodowski.net> <20171230153054.GA1604@light.dominikbrodowski.net> From: Linus Torvalds Date: Sat, 30 Dec 2017 12:45:39 -0800 X-Google-Sender-Auth: qWpo52jCIcTcooosKjuXDxEYx88 Message-ID: Subject: Re: x86/pti: smp_processor_id() called while preemptible in resume-from-sleep To: Thomas Gleixner Cc: Dominik Brodowski , Andy Lutomirski , Dave Hansen , LKML , "the arch/x86 maintainers" 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: 1032 Lines: 31 On Sat, Dec 30, 2017 at 12:28 PM, Thomas Gleixner wrote: > > That preempt_disable()/enable() was added with: > > commit 5cf0791da5c162ebc14b01eb01631cfa7ed4fa6e > Author: Sebastian Andrzej Siewior > Date: Fri Aug 5 15:37:39 2016 +0200 > > x86/mm: Disable preemption during CR3 read+write > > So we need to look at that scenario before removing it. Good point, but I think that was actually a mis-feature of the old "__flush_tlb_up()" implementation that Andy got rid of in commit ce4a4e565f52 ("x86/mm: Remove the UP asm/tlbflush.h code, always use the (formerly) SMP code"). So the code sequence that that commit talks about no longer exists. Instead, we now have the call to __flush_tlb() inside a get_cpu/put_cpu, which is preempt-safe even on UP (despite the CPU number obviously being fixed). So I think Dave is right: we should just remove the preempt_disable/endable. But adding a WARN_ON_ONCE(preemptible()); might still be a good idea. Linus