Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4341644imm; Mon, 30 Jul 2018 12:50:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfuqxCx6g7aWcfdQfiwvFESi5D7R4EH8QyQZqXPPz1VhM/Gq0pBq4qJm9uGIPyyphU1NyP3 X-Received: by 2002:a63:291:: with SMTP id 139-v6mr17709374pgc.365.1532980238569; Mon, 30 Jul 2018 12:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532980238; cv=none; d=google.com; s=arc-20160816; b=foK4cws6vMlYEUKK2LfTRHln0aBtWWtDtacVNonC4s2R6pl4zNje7PuxbtzcqnX1Nu 4AtHsNmJevIgTNlSE4sjHB/0KHVpufM5Pgyli5UjrBPXvWmiNaKfYTMs9ZseZBP0G17t +djv/fwKQAGeTrJuq2IrjuM8H5sHx5BjePTOXGb7AN9y/s4REnoFqPzHgk+46XI1DN0L /O4iOZe5c5gs/eWAnORLhZz8wQ87aG5zo1l2kT+rlqxVzGtMm7og0cm7gWBLzUmxp/10 cdnqt3jIwWYUKOg65FEPEsB9r7SsuZ0XVLyxOrf8lyyfcXzbBdHX0z4q9pELL3gooqWh Al0g== 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=59dtp33w4mVCliljObMrym+XXHRqHcUSdUqAlqaTebo=; b=txjJfPqD0GqmJpDzMO337aYwDSVVIUJT+UNhSGMQEePjnF5yE6PuwU6RRWj+8PiAUD 5GNtzK/OPsbpQBsXZiMLLADIHkFC5jH5ugjc/S6mmX3TuvN99d6hRH6wbtTf+COxhkWd dObTb75VPniNUjV8f6SN0Vf3y5QbkDciFLIjHIhkkvI/oNl9p6I3H7/qzIAY/5ZJ7EJ7 DF14/P4Xd8tmN1rIUmGNLXXXpqpEJ6V/DbPkii+fQi0j+koC8J6cOP3rXsszMIloL0mk 6ayeBm9aeeOpFWS9KRymgNl8Qt9aelcScYmZLSDpMB1vvJxMirgEDuJokF/qHVJKuhtc QSPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0Qtz4jc0; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si11935756pgi.184.2018.07.30.12.50.24; Mon, 30 Jul 2018 12:50:38 -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=@kernel.org header.s=default header.b=0Qtz4jc0; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731961AbeG3V0I (ORCPT + 99 others); Mon, 30 Jul 2018 17:26:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:53438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbeG3V0I (ORCPT ); Mon, 30 Jul 2018 17:26:08 -0400 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0881B208A4 for ; Mon, 30 Jul 2018 19:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532980175; bh=SotUQrJOELAFN9wB6Ip+Qb1yHoerjziQ1jLvoClnwf0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=0Qtz4jc0KwPOxS8sLk6sfshBXWLzO+IDUGrg7p11LZ8XoBTy7OtTqWMCuzS/pbux6 jxPnxOpyIhDvH84Q96GBXMR7RT8Pp20pR/Y++LGMsEgpJhyDeMV4dBm1C/7azSlpkR vlSdi+98PkCjldDZsWvpvGzn0cRhIdTYJvPd0Fmw= Received: by mail-wr1-f42.google.com with SMTP id e7-v6so14120882wrs.9 for ; Mon, 30 Jul 2018 12:49:34 -0700 (PDT) X-Gm-Message-State: AOUpUlFt6N2ghYpSp1eln8UcfJcH/G76K7kbTa3LJ7f0XppnrLoyTFnp DJ+mAUvvGdDw9/aDxR3RNHwdHYlHZjmPdpFZ8Yktdg== X-Received: by 2002:adf:fe42:: with SMTP id m2-v6mr18214325wrs.171.1532980173491; Mon, 30 Jul 2018 12:49:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:548:0:0:0:0:0 with HTTP; Mon, 30 Jul 2018 12:49:12 -0700 (PDT) In-Reply-To: <1532979368.28585.33.camel@surriel.com> References: <20180728215357.3249-1-riel@surriel.com> <20180728215357.3249-11-riel@surriel.com> <20180729155452.37eddc11@imladris.surriel.com> <20180730095502.GG2494@hirez.programming.kicks-ass.net> <1532961011.28585.30.camel@surriel.com> <20180730162653.GM2494@hirez.programming.kicks-ass.net> <1532978146.28585.32.camel@surriel.com> <1532979368.28585.33.camel@surriel.com> From: Andy Lutomirski Date: Mon, 30 Jul 2018 12:49:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 11/11] mm,sched: conditionally skip lazy TLB mm refcounting To: Rik van Riel Cc: Andy Lutomirski , Peter Zijlstra , LKML , kernel-team , X86 ML , Vitaly Kuznetsov , Ingo Molnar , Mike Galbraith , Dave Hansen , Catalin Marinas , Benjamin Herrenschmidt 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 Mon, Jul 30, 2018 at 12:36 PM, Rik van Riel wrote: > On Mon, 2018-07-30 at 12:30 -0700, Andy Lutomirski wrote: >> On Mon, Jul 30, 2018 at 12:15 PM, Rik van Riel >> wrote: >> > On Mon, 2018-07-30 at 18:26 +0200, Peter Zijlstra wrote: >> > > On Mon, Jul 30, 2018 at 10:30:11AM -0400, Rik van Riel wrote: >> > > >> > > > > What happened to the rework I did there? That not only >> > > > > avoided >> > > > > fiddling >> > > > > with active_mm, but also avoids grab/drop cycles for the >> > > > > other >> > > > > architectures when doing task->kthread->kthread->task things. >> > > > >> > > > I don't think I saw that. I only saw your email from >> > > > July 20th with this fragment of code, which does not >> > > > appear to avoid the grab/drop cycles, and still fiddles >> > > > with active_mm: >> > > >> > > Yeah, that's it. Note how it doesn't do a grab+drop for kernel- >> > > > kernel, >> > > >> > > where the current could would have. >> > > >> > > And also note that it only fiddles with active_mm if it does the >> > > grab+drop thing (the below should have s/ifdef/ifndef/ to make >> > > more >> > > sense maybe). >> > >> > I'll kick off a test with your variant. I don't think we >> > will see any performance difference on x86 (due to not >> > using a refcount at all any more), but unless Ingo is in >> > a hurry I guess there's no issue rewriting this part of >> > the patch series :) >> > >> > Do the other patches look ok to you and Andy? >> > >> >> The whole series other than the active_mm stuff looked okay to me. > > Does the active_mm stuff look like a step in the right > direction with the bugfix, or would you prefer the code > to go in an entirely different direction? I think it's a big step in the right direction, but it still makes be nervous. I'd be more comfortable with it if you at least had a functional set of patches that result in active_mm being gone, because that will mean that you actually audited the whole mess and fixed anything that might rely on active_mm pointing somewhere or that might be putting a value you didn't take into account into active_mm. IOW I'm not totally thrilled by applying the patches as is if we're still a bit unsure as to what might have gotten missed. I don't think it's at all necessary to redo the patches. Does that seem reasonable? > > If this looks like a step in the right direction, it > may make sense to make this step before the merge window > opens, and continue with more patches in this direction > later. > > -- > All Rights Reversed.