Received: by 10.223.164.202 with SMTP id h10csp1218078wrb; Fri, 10 Nov 2017 00:05:41 -0800 (PST) X-Google-Smtp-Source: ABhQp+RuLDlnU6k2ZYKPhXPlEMaQY61WbaPl5AGA1UnD7oMJloPTGeXJtBjwO46jw/DnrHBbqsU1 X-Received: by 10.98.109.134 with SMTP id i128mr3503629pfc.66.1510301141555; Fri, 10 Nov 2017 00:05:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510301141; cv=none; d=google.com; s=arc-20160816; b=v2OAgOUcUgX89Mj8H8ADFMZgLtqxorr30gXeBXIu054T9FRnFWjx/p9L+3Q8LQ//Fl zjCjFsFJ35Oj+UFL5anWbGCDmlLGnXLaHDFm0b369SbmrBamNX/4ZRYvRQmzD0/5n9Kt gsnFoPrO2CtXcHQevH/npWOvTKudWTv/d6yNReB9F7X9DrX0dLj3cGuR8DPfrTNvFrRY GYcZr1wIWmHrwx2B37bR7NZB055xcmp5TDwo6ZhDhCJWCQ21vgUk73RIivIjnhqj7xBS LaZUmo0Z5v+4rdnY4+wuR4LRVEuUaIyuN1eYGAl3BhtRc1HJVoudWGTTJtToqXSX18OY Razw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=jAT9ByotWzNge3+aruAcYLcDq541ta/E5vuvJc1BzO8=; b=Arqa42EG6TH+PhETCOR0WTqbbn9TYeZaLQviem7zY/mgXl13FCBl2MjL4U8T0EAUFt Z26aaBgUabebQrhEX942TwrloMLC9ahAcAIiTAA5s0jnIEU1QBaV0BL4ZgNFvVK/7gLK jt+33T3DfwFwgZOunIRGWd8IY7t62fnzHNKrtd8AbP07rRqoYQmmTPKsu4Jrt7DoYA6+ QupvOqnBaOtHM6ljKISvRadJ7AImMW5ZLHgDo/Whm+iYhs8BM9lzeevRTjMAS2bI/qZv tKjweqtiVjkcGi4UHUpjmvNZwarmzG6k35MhNMOflq3n+IvvVcU3EyU8sm2TPcidRU0L rKHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WtVer9+l; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y68si6118783pfk.100.2017.11.10.00.05.29; Fri, 10 Nov 2017 00:05:41 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=WtVer9+l; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755825AbdKJIEw (ORCPT + 83 others); Fri, 10 Nov 2017 03:04:52 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:53102 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbdKJIEt (ORCPT ); Fri, 10 Nov 2017 03:04:49 -0500 Received: by mail-oi0-f67.google.com with SMTP id r128so6291415oig.9; Fri, 10 Nov 2017 00:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jAT9ByotWzNge3+aruAcYLcDq541ta/E5vuvJc1BzO8=; b=WtVer9+lM3Jmkutit4r33O3KkfU6mGw208xrUH9MKxjCflrwl3i2UPKrkYUyO/M0Wy BZdhSWsqq034Sua5IUQ0DAqLRDBfKj+sXsdSR5AG4o/itpe8j3zfXzuwtf0bOQegdtla HtnMRPtbOQmzOZvuAfRoi4Y3bfDviw0GRhFDJYJemwGZRzu06R1BlVC5QkCrwoCfFDwe ElTyIh1D3oITmCUiiEQWFo72z29mIvdGX5VUJqnvgHipAPbFxLimGxS4XHWOiXWElG3X 4wbDid6mVE2i0hBt9D79coTztBzflg0z1chO6sI6FBltNtxtCjrwfLtP3A7DB31RHZix xEBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jAT9ByotWzNge3+aruAcYLcDq541ta/E5vuvJc1BzO8=; b=rH9vOf2EiEcKmwvxGyQ9lvD+JMz6fh7VmH/Vzt70bL6aRJjtdb/ylGbdD+eQ/jwNCM kLnRZZrP88MJgTnLO5J6mPg1yGvdydxIwmePk86vJ+MYqAUE6CConMAWCYbewUXkZBRc G+SIBAGEbCbajZcpWzBsdlqLaNsLobimSkcxj1KqvImYwnXP6BPsFcfi+6JEzzlnV2w5 x1GS71PdatQVZXkrwY/xYE50/MU9oJGDsufYoY+mugpBcGlV4u3wKwNQQHNLaSP7Tiea /eoOAcyxIXzu/tFvTvEMfkjFxCf1ONF90R/wGXR5MdVl93QfloCIuR04WC29UTtOXpyG xjTQ== X-Gm-Message-State: AJaThX5dEZiUhSQXLxT7mU2O32fkAHUjQ0oLCMZEa5+oSb37WyNC3LEU ehVub4NcWPoBBKIu+9AYGiEcBGAA5resaHDnOu0= X-Received: by 10.202.234.2 with SMTP id i2mr2007098oih.348.1510301089103; Fri, 10 Nov 2017 00:04:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.53.27 with HTTP; Fri, 10 Nov 2017 00:04:48 -0800 (PST) In-Reply-To: <20171110075914.mcjp2niadqszo3yb@hirez.programming.kicks-ass.net> References: <1509999980-10828-1-git-send-email-eduval@amazon.com> <789734192.29237413.1510242805535.JavaMail.zimbra@redhat.com> <20171109160536.GE20859@flask> <20171109161701.y3eqqrvs5jpg46lr@hirez.programming.kicks-ass.net> <20171109164523.GF20859@flask> <20171109171241.43zpahj24mhzzp3y@hirez.programming.kicks-ass.net> <20171109171511.gckh2lt7xksmiern@hirez.programming.kicks-ass.net> <20171110075914.mcjp2niadqszo3yb@hirez.programming.kicks-ass.net> From: Wanpeng Li Date: Fri, 10 Nov 2017 16:04:48 +0800 Message-ID: Subject: Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set To: Peter Zijlstra Cc: Radim Krcmar , Pankaj Gupta , Eduardo Valentin , Paolo Bonzini , Matt Wilson , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "the arch/x86 maintainers" , Waiman Long , kvm , linux-doc@vger.kernel.org, "linux-kernel@vger.kernel.org" , "Jan H . Schoenherr" , Anthony Liguori Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-10 15:59 GMT+08:00 Peter Zijlstra : > On Fri, Nov 10, 2017 at 10:07:56AM +0800, Wanpeng Li wrote: > >> >> Also, you should not put cpumask_t on stack, that's 'broken'. >> >> Thanks pointing out this. I found a useful comments in arch/x86/kernel/irq.c: >> >> /* These two declarations are only used in check_irq_vectors_for_cpu_disable() >> * below, which is protected by stop_machine(). Putting them on the stack >> * results in a stack frame overflow. Dynamically allocating could result in a >> * failure so declare these two cpumasks as global. >> */ >> static struct cpumask affinity_new, online_new; > > That code no longer exists.. Also not entirely sure how it would be > helpful. > > What you probably want to do is have a per-cpu cpumask, since > flush_tlb_others() is called with preemption disabled. But you probably > don't want an unconditionally allocated one, since most kernels will not > in fact be PV. > > So you'll want something like: > > static DEFINE_PER_CPU(cpumask_var_t, __pv_tlb_mask); > > And then you need something like: > > for_each_possible_cpu(cpu) { > zalloc_cpumask_var_node(per_cpu_ptr(&__pb_tlb_mask, cpu), > GFP_KERNEL, cpu_to_node(cpu)); > } > > before you set the pv-op or so. Thanks Peterz, :) I will have a try. Regards, Wanpeng Li From 1583665288713573082@xxx Fri Nov 10 08:01:51 +0000 2017 X-GM-THRID: 1583352031107436177 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread