Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1944101imm; Thu, 19 Jul 2018 10:20:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfyUk02Hum3AtpsXoPENl8cxo1z5R51FHGfqRm2PeHUi5+fZu+T2sLF0jVzVEnnBhwOhWaT X-Received: by 2002:a17:902:740a:: with SMTP id g10-v6mr5804712pll.204.1532020855743; Thu, 19 Jul 2018 10:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532020855; cv=none; d=google.com; s=arc-20160816; b=FmSXhbYb69MjtjFBqof7UQWkzcDqfFSjabPut3aiQh0+WfC7Utyo2TD6VNokyQJkJl PBEOzHkgrMHoRwGiIjLOSLqrUEgwSDgIbktVPZVXniA1m39YQxVahNIvFImkAISXxj+z m1osIMd58X7iqdgwjMC4K4EOoQa71hjMhORcpyk7EcmDf/cXS8+MpLcndDEsY11n+Kc3 ROhNHA+S/WG2f5qfsNCD1aYOct9p5djNR7wB9jojqYYvwkPdsnUd8qbit9KF1560C4EH wZ+hQyM3I5RQIgM5fCKk0hJXTU5OJ1V0GJJ7hC/APfo9OVBtV9tVfLDM3Ql97yIngzOk jSqA== 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=Bi7qXTqIqqOkMu9MhQdvDqN1g+dFA1suX1IF7EWLlCM=; b=fbaw8tmHlZs/I67MNWq5ZZWxDi+BuggkJ8faqWXskblTM+yZbQpjvr+mbtz06TWGVG wyWqAhRzjaz2ubOSBlHNiQZcX9/hi6PilG8a3wQfFmxO5sWYd5dj3/ky7lE8RKKFi5DL 02a8Rpa/9C09EFIkIAKYnP/0l1lDUc3dq1afZYePRUFzewhOEH2VTdfHCh3rJSq5+Ozt mWpJUNAbh/MFFfQFpfcyfdz0x4aE+AQ/Q2XkdJ6qd17oB3E0eimChHXFfBSI+9b9wh8G oti1fgzKX7EZ8WVP738YBVkkutTdZUC9cP6h+0JTN9rF56B1BwDDsliTgSZW16JsbdLP UNdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Txwzqio5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si6312758pgl.140.2018.07.19.10.20.40; Thu, 19 Jul 2018 10:20:55 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=Txwzqio5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732122AbeGSSD2 (ORCPT + 99 others); Thu, 19 Jul 2018 14:03:28 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54283 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731442AbeGSSD2 (ORCPT ); Thu, 19 Jul 2018 14:03:28 -0400 Received: by mail-wm0-f68.google.com with SMTP id c14-v6so6991831wmb.4 for ; Thu, 19 Jul 2018 10:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Bi7qXTqIqqOkMu9MhQdvDqN1g+dFA1suX1IF7EWLlCM=; b=Txwzqio5JQAEMgkp3ymWi+zXijyogF19bJllgIUBjr7vCp1GR/WSISIVKqrPH9AfMo j05wJp/j8/O0RUvI7dsanUXSjXoErR1QoFcJG8iaz8C1TjMVI9RHGysz6pZFpTSFxnJE mcyJnxnjSoVoHYoommSjYVGvnIqaQ74+A+HW20HrD0khhP9wEBhVx1kV139NxqbCZ2pe zFw4ZbWk29vlWf5b/oROfmy8OePA+h8AXRrCfVz0qs1EuSKfOCi/Jd48w8gGezwEyVF5 rESS3l2bQMy+duKA6/I1KP6KU++A+hQ1IMsOPyj6LG7iBHYt7Duef6X9OUc1tnizAAg1 8RXA== 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=Bi7qXTqIqqOkMu9MhQdvDqN1g+dFA1suX1IF7EWLlCM=; b=br9uqPhM69OjOUEXdG+N3Pxa5eztadyewXuebTGsBqfPAW/Pi/+kmM+inDK90IGS10 E7btNyIJUsvsQEfotPyAmA9qpvf2j8k5p7aDp42V9PuBKqDMaMUhAzAROntz42/9E0JL cQx14sL2WZQFUPogYPCDOSMNEeFt9KmxcqRFcrIyV+T0w2V+Rh33UHDoXWQnWp/3iT55 yWQs5CbuZudIevbwpCA2k6eHhBrNlbhGkyU/YmifQoHZPf5P1jKFYuCvJ+G+IZhZJjNR N4hBzF8rDaNVqfA1pKTCjGXHeMcuZKhQ/tijVL96vn/TEkTskppUI7cOwD9JNCJw+ws0 H3Fw== X-Gm-Message-State: AOUpUlEn/Cvg0q27h6NWq4QsXV0dPh/KiPQDkjT0D1M3zDhFh4SxFm+S 39FdtcmlAyJ/+8INkczC6q+qUFvJ+sQzMzONUhFB7Q== X-Received: by 2002:a1c:8b0d:: with SMTP id n13-v6mr4460000wmd.46.1532020759529; Thu, 19 Jul 2018 10:19:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:d548:0:0:0:0:0 with HTTP; Thu, 19 Jul 2018 10:18:58 -0700 (PDT) In-Reply-To: References: <20180716190337.26133-1-riel@surriel.com> <20180716190337.26133-5-riel@surriel.com> From: Andy Lutomirski Date: Thu, 19 Jul 2018 10:18:58 -0700 Message-ID: Subject: Re: [PATCH 4/7] x86,tlb: make lazy TLB mode lazier To: Rik van Riel Cc: Peter Zijlstra , Vitaly Kuznetsov , Andy Lutomirski , LKML , X86 ML , Mike Galbraith , kernel-team , Ingo Molnar , Dave Hansen 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 On Thu, Jul 19, 2018 at 10:15 AM, Rik van Riel wrote: > > > Given that CPUs in lazy TLB mode stay part of the mm_cpumask, > that WARN_ON seems misplaced. You are right though, that the > mm_cpumask alone should provide enough information for us to > avoid a need for both tsk->active_mm and the refcounting. > If you do this extra shootdown after freeing pagetables, it would be odd if mm_cpumask() wasn't empty. But you're right, the warn is probably silly. And if you move it into arch_exit_mmap(), the warn is definitely wrong. > > Does all that make sense? Basically, as I understand it, the > expensive atomic ops you're seeing are all pointless because they're > enabling an optimization that hasn't actually worked for a long time, > if ever. > > > Our benchmark results suggest that lazy TLB mode works, and makes > a measurable performance difference. Getting rid of the atomic ops > should make it a little better, though :) > I'm not saying lazy mode is useless. I'm saying that active_mm isn't needed for x86's lazy mode :)