Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp258261imm; Tue, 24 Jul 2018 18:34:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeyduOxvlnM7cOQwJTMcIdY5TmsQOfNFth5wVzTeLdRcb4SnHjXw2OuYHGM/LoR0+ZCMBRb X-Received: by 2002:a63:9741:: with SMTP id d1-v6mr17939879pgo.403.1532482464208; Tue, 24 Jul 2018 18:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532482464; cv=none; d=google.com; s=arc-20160816; b=doZM6Q5O1+u7xy3sXzhgM+SQD97yUB011ONZ1/QmQhVuLYVrdsSwGlutIbpPA8tKg+ ci/baizC+Oguu4HywNdjfnJ4BCwPec7SjytVguU2GvCd+x7Cr72BIkPABl97wq5ZoN5n Jec11A58Yne5xrIgajid9JPAKLOheIqAqWiGHQ/hN+lub+4DHJ9ZWvdE54uJc8Wy5Cue ERs5b2EliEgHiCuDsYZvZTGLD7O22pXBlYIfUfKT/VczV6GNZ02tgyQSWs36ThcvuEkD evxzzwWROUr/3x3FHaYCnkf45v2a5QLkt8d9Zu7n+T+O5+CW12a4QpWayIZHphp/p1Ar TKGA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=rWCQLzHYthqwSLNObBEn88/JuK+fQuRSAhkyzTRA02Q=; b=uEei9CpNMuFgGbYFpD10AjEgSJn/bqsE3BWNpSdvW/ie01BSUCuNu9wo4jR+cDx+Ru u9xFRFP2Cf5gKjAo58DIIFNIKVSB9xeYyx60Yrj3swdeNZ4Kxm+I+3TEvHHU7by2UwvL s+BpSNHc6H9/a3VvRArc2dNe14ViwwUy40SmwAtQio94j6+iU/aW/qE1y8w7Wt8+NoVY 7CofU1CWPBiV0njYirFIUUFaHfVbkMt3iVwu8zV8q5jDpRdgzY6g2V1VMS60dIPZq653 L+PnrJwtf25qUHzeTHDEnyOn0rRDB/YTsWXQ7HDRRtviEAadVabugfZsYUOpEhVRHZ46 FcjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tz9NelQR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13-v6si13007712pgc.670.2018.07.24.18.34.09; Tue, 24 Jul 2018 18:34:24 -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=pass header.i=@linaro.org header.s=google header.b=Tz9NelQR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388650AbeGYCmT (ORCPT + 99 others); Tue, 24 Jul 2018 22:42:19 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:32986 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388517AbeGYCmT (ORCPT ); Tue, 24 Jul 2018 22:42:19 -0400 Received: by mail-lf1-f68.google.com with SMTP id u14-v6so4293570lfu.0 for ; Tue, 24 Jul 2018 18:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=rWCQLzHYthqwSLNObBEn88/JuK+fQuRSAhkyzTRA02Q=; b=Tz9NelQR1zlSgaUZ9MtTZIQsv6Mxxvte/T/J9hKU96vKz+2S+dLXHXHbMsGHYrkmKr FtP8K5hJuahvuIsb0uI85kXNMhgLC1zHGH3culaEy2MXA8PA8vlg1EU+SKWTwCutckj1 GLqEeq0PNOKe/cu52bgprMLPDEAGH0moiNydY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=rWCQLzHYthqwSLNObBEn88/JuK+fQuRSAhkyzTRA02Q=; b=qiHVPu2Q2s9sIw5q5MSW09+gGMQd+d0W7U77Y0iAxLXAC5rryjMt9bNd5w88Nje9GG fZoaG0IGX1+b9DL2et082A+trx3+zWn2SyIqvVmyjyDgBW/RwtYqSM0vmG0rAzU1TEpK AZdOPb72auDZ8Op8ml/uHunw2mfemTfi9gIcFYbMyJh/CF6RhI/I62E6onK6yo6LyomG 8gzhoP/+ujGk+0jdCeL7zy7CCe9OYxCUZ694mxqBqkP2o0l6cqBqG/jvwf6frP53BU6+ Hoc9gKydyvMVbnPKUjeW47cjTB8S0cg5CZApPlDoAFkT+2muGDhwyo9EuIP2/IpQP7v0 ze3g== X-Gm-Message-State: AOUpUlG152mv0oed5+XaljQJI/HsbPoqwlMxwkRs75PNmD5F/FUvqPEU JDVWv+T9EosIcGnBoQJRGwxrDw== X-Received: by 2002:a19:4344:: with SMTP id m4-v6mr12013831lfj.111.1532482384335; Tue, 24 Jul 2018 18:33:04 -0700 (PDT) Received: from localhost.localdomain (c-2c3d70d5.07-21-73746f28.bbcust.telenor.se. [213.112.61.44]) by smtp.gmail.com with ESMTPSA id z90-v6sm2517169ljb.59.2018.07.24.18.33.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 18:33:03 -0700 (PDT) Date: Wed, 25 Jul 2018 03:00:52 +0200 From: Anders Roxell To: Peter Zijlstra Cc: tglx@linutronix.de, mingo@kernel.org, songliubraving@fb.com, torvalds@linux-foundation.org, riel@surriel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, dave.hansen@intel.com, linux-tip-commits@vger.kernel.org, rafael.tinoco@linaro.org Subject: Re: [tip:x86/mm] x86/mm/tlb: Leave lazy TLB mode at page table free time Message-ID: <20180725010052.GA2502@localhost.localdomain> References: <20180716190337.26133-3-riel@surriel.com> <20180717114647.GW2476@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180717114647.GW2476@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-07-17 13:46, Peter Zijlstra wrote: > On Tue, Jul 17, 2018 at 02:34:07AM -0700, tip-bot for Rik van Riel wrote: > > diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h > > index 3063125197ad..e811ef7b8350 100644 > > --- a/include/asm-generic/tlb.h > > +++ b/include/asm-generic/tlb.h > > @@ -303,4 +303,14 @@ static inline void tlb_remove_check_page_size_change(struct mmu_gather *tlb, > > > > #define tlb_migrate_finish(mm) do {} while (0) > > > > +/* > > + * Used to flush the TLB when page tables are removed, when lazy > > + * TLB mode may cause a CPU to retain intermediate translations > > + * pointing to about-to-be-freed page table memory. > > + */ > > +#ifndef HAVE_TLB_FLUSH_REMOVE_TABLES > > +#define tlb_flush_remove_tables(mm) do {} while (0) > > +#define tlb_flush_remove_tables_local(mm) do {} while (0) > > +#endif > > Is there a reason these are not inline functions, which gets us type > checking and the like? More to that, when building (linux-next tag: next-20180724) on arm 32 there is this build error when CONFIG_MMU is enabled, asm-generic/tlb.h isn't included, see arch/arm/include/asm/tlb.h. CC mm/memory.o mm/memory.c: In function ‘tlb_remove_table_smp_sync’: mm/memory.c:339:2: error: implicit declaration of function ‘tlb_flush_remove_tables_local’; did you mean ‘tlb_remove_table’? [-Werror=implicit-function-declaration] tlb_flush_remove_tables_local(mm); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tlb_remove_table mm/memory.c: In function ‘tlb_table_flush’: mm/memory.c:372:2: error: implicit declaration of function ‘tlb_flush_remove_tables’; did you mean ‘tlb_remove_table’? [-Werror=implicit-function-declaration] tlb_flush_remove_tables(tlb->mm); ^~~~~~~~~~~~~~~~~~~~~~~ tlb_remove_table Alternative could be setting in every architecture's asm/tlb.h but that doesn't make much sense. Other way would be to include prototype in arch/arm/include/asm/tlb.h, not sure if that would be the best. Is there any other place this could be defined for fixing issue in arm 32 bit ? Cheers, Anders