Received: by 10.223.164.202 with SMTP id h10csp573401wrb; Wed, 15 Nov 2017 04:41:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMaCApGr0HH+++8MqHnlqTWj7Z9I56wGVROttZ+rL6qBsV9TR89ySrEe5seVwvL69j+omYPC X-Received: by 10.99.123.14 with SMTP id w14mr13315913pgc.172.1510749709961; Wed, 15 Nov 2017 04:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510749709; cv=none; d=google.com; s=arc-20160816; b=JuefkeYP7Em2TAhwSKbc8k/TixHEaVMTDdL6QiTZpAEAJIqqg3NLKsD2lZ6/z9R4/V tPJohJPl0k4RHkiAP6Kef68Sprcb/TY1v79ukdKNpGJiD9FqPO0L/FKFX7LChv9Ektyy ztlajtKvReauOlNZnjyTnyRizQmq9CtlUk6HsMywwskon3cISUjKnAp2fSZYM7P3wiIM NYQj6gKtO9vXI/WubBJ60S5dJfv0LyJr7ZzM+CVPm5kD7rh1+LjmC7VEa2HnYz2bX+99 +c7z56ieVEQwIRS6DT78h99qbVwbhLj2TbLt3fHQdUp31FGppBucduw31IQC+PYPJwb9 d8pg== 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=Oln/8ibtQ6eePmwknzg+AF8bbzcfo+QZMPBzMwDtr/4=; b=kS5mYG6SbJSBnfXo43YzA1KbPo+Q876iyf6XWDvGFBabWa2z0KjUgGEubPhDaPxtjs ljAfjkYG+BwoJgOIam6WEU3/V3LJTY60unA8ROg0RSwCGn+IWyb1APsvvIxkOE21NU/y m4XJi8q4N8CBCMzvDc8uajMUYyotLl21m/Tha3a8xGdWM7d/wxwzrk69PAXYSNKr3cYb HzQQU/QDcitkickV+Du3ONyUgGi5EEGHPmNf26Ry/XqJ1Iae3wHDDKIbdSbJJQVZz7Y4 GD8xtBpTwQGyfG4HTvAQ/4FjKXypCPVn9u/BXs5ayt7HY5srnbIY0BaExmeP39fmQxrw 5zSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E7SQBnry; 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 f9si17445151pgt.760.2017.11.15.04.41.37; Wed, 15 Nov 2017 04:41:49 -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=E7SQBnry; 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 S1757727AbdKOMUL (ORCPT + 90 others); Wed, 15 Nov 2017 07:20:11 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:50629 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbdKOMUE (ORCPT ); Wed, 15 Nov 2017 07:20:04 -0500 Received: by mail-ot0-f193.google.com with SMTP id g104so7335824otg.7; Wed, 15 Nov 2017 04:20:04 -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=Oln/8ibtQ6eePmwknzg+AF8bbzcfo+QZMPBzMwDtr/4=; b=E7SQBnryQXIwcIGL3G63pQ6O3oATX1OfbJxZfit0yyKLIeHBF9yKrIFS7FyUmCBXYa M9h/VQ4QxnfrdUNuz5EsrebXQWRW8no/X8OByf5fEL6su9xqcgN2FDlCOd4vpAeGrmKF 3TsP004bzNbNn7NBtCB/fyJ+B4Hk7/vIfy3mr/VlZNs20mGdALgUuceZXdUB7PX7TDAX ba7yE+QIMBWRO7A70jF3UxeHs+zJwoJFf3vfEBW9EcfR/BCRKA5BgBFaaa8Qr+9qoDno yIdKuQ9PHuvE9zBvLsv9oIONL0RxEaRwf4i0Pa6sFTo5wlEdSzgco20gD8OA+TQUq02v w4iA== 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=Oln/8ibtQ6eePmwknzg+AF8bbzcfo+QZMPBzMwDtr/4=; b=LduDVfu5bmzsMWunoKNhSLu44EAWqhe+sxvwtuoR/TmdzoOw3D1CHD/2as26PZXgA4 64TVpcwXUA8gHldpNstsrX0zqwdWxZ4LH4PheylYDJajGc6wSgSkyn5sjAfLZd4a09JO VDBOBUqWTh8YILgD0hwW46kdt9aRuefK21VrmsCWe/HpUN5BUOmUvSuB71G7FKuoBuIW YuLND6E+5+i5DdEN9gpVUUCW/QQC1088CXcmDupmrPHcx2TZRL29eMmh4zaHuraaNi7S oBOcs3J+t454Mnrg2u6DfWBMbAhpJofDY9+E2sDbo4G0h71Tjc7PFff2KD2SSKbs72es 6DHg== X-Gm-Message-State: AJaThX6DqjeHeg4iBF/sv5weaQYmAn6lN4F7IrKzPGHvyfKD/gbm9PB7 jv8iRFfnM0VqkTh1GOsuj8Zcg5quwp4brYvR58o= X-Received: by 10.157.85.150 with SMTP id m22mr10269588oth.218.1510748404302; Wed, 15 Nov 2017 04:20:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.53.27 with HTTP; Wed, 15 Nov 2017 04:20:03 -0800 (PST) In-Reply-To: <20171115095425.2hsgpfomdmdru7ke@hirez.programming.kicks-ass.net> References: <1510297497-10063-1-git-send-email-wanpeng.li@hotmail.com> <1510297497-10063-3-git-send-email-wanpeng.li@hotmail.com> <1a42f32f-3f2a-0c05-bd50-e6c3c710be85@redhat.com> <20171115095425.2hsgpfomdmdru7ke@hirez.programming.kicks-ass.net> From: Wanpeng Li Date: Wed, 15 Nov 2017 20:20:03 +0800 Message-ID: Subject: Re: [PATCH v2 2/4] KVM: Add paravirt remote TLB flush To: Peter Zijlstra Cc: "linux-kernel@vger.kernel.org" , kvm , "Radim Kr??m????" , Wanpeng Li , Paolo Bonzini 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-15 17:54 GMT+08:00 Peter Zijlstra : > On Wed, Nov 15, 2017 at 04:43:32PM +0800, Wanpeng Li wrote: >> Hi Peterz, >> >> I found big performance difference as I discuss with you several days ago. >> >> ebizzy -M >> vanilla static/local cpumask per-cpu cpumask >> 8 vCPUs 10152 10083 10117 >> 16 vCPUs 1224 4866 10008 >> 24 vCPUs 1109 3871 9928 >> 32 vCPUs 1025 3375 9811 >> >> In addition, I can observe ~50% perf top time is occupied by >> smp_call_function_many(), ~30% perf top time is occupied by >> call_function_interrupt() in the guest when running ebizzy for >> static/local cpumask variable. However, I almost can't observe these >> IPI stuffs after changing to per-cpu variable. Any opinions? > > That doesn't really make sense.. :/ > > So a single static variable is broken (multiple CPUs can call > flush_tlb_others() concurrently and overwrite each others masks). But I > don't see why a per-cpu variable would be much slower than an on-stack > variable. The score of ebizzy, bigger is better, so per-cpu variable 2~3 times better than on-stack. Actually I find what happens here. :) + for_each_possible_cpu(cpu) { + zalloc_cpumask_var_node(per_cpu_ptr(&__pv_tlb_mask, cpu), + GFP_KERNEL, cpu_to_node(cpu)); + } This zalloc_cpumask_var_node() returns NULL and fails to alloc per-cpu memory. There is a check in my kvm_flush_tlb_others(): + if (unlikely(!flushmask)) + return; So the kvm_flush_tlb_others() skips all the tlbs shutdown, I think that's the reason why the score of overcommit is as high as non-overcommit, in addition, it also explains why I can't observe IPI related functions by perf top. Regards, Wanpeng Li From 1584132919665106820@xxx Wed Nov 15 11:54:39 +0000 2017 X-GM-THRID: 1583661871160144366 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread