Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3922103ybz; Mon, 4 May 2020 12:11:55 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6q7tOPqQigMrN7ErSrHkqMChdgXe/zz3wmwhOlXzPi3h7KHRW5ypNizuJNuWOGP3EsEvz X-Received: by 2002:a17:907:2049:: with SMTP id pg9mr16492640ejb.248.1588619515265; Mon, 04 May 2020 12:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588619515; cv=none; d=google.com; s=arc-20160816; b=waxMMZT6CXmBZC8ir+DgVhLXdxSKCQp/fsO2dl7I0DO20RGeT0aA/ojFif0DZB67Si hqDBNJwDDWkrpZbb0L4WBFJTT12zER/HKbdbTnEquN7KcUke0BMtVeKKBQ72RI7Bq3Ra Zbb7I5Ak0E9ckoJuDHNG4mvrgyy72tS0NIYHLOATTQXGI3DMjfEkH3itCtl7pxnrqK8g HFIMyMhxZlXh7YL4OpC6zdF39vrxCpd0GDKC2wk2oohBaHh2gND8GytbFplLkyIiFCz7 tQnSf+AvM/1vmiMPwUUMcXGj+JoA2bE13YRJHbHHxgRZ6uwUhCjn5/6miKZrusfBcD6M J/Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=2sFM3mjHw0xY1hdKwC8/vHy7R2JjmwFtmd2Ur5wQjsc=; b=kJx6SuGNUJRyKUfdKhNb3XEY+EOJh+U5Su+pOjXm8OJu214KNa59VmXuEtBqubrqk/ 1SINli8eJ2BuM14n3ui1xCDqHzI1rY0Vm+OXsvDgA2Y8aT+O9ynpC2RV0luoIWq/T8TF TczOXZGrPfIDWUH31Na55qNZ1Lsvrw4ZCXIkm4ceujLzYaNM76uO3fyAD5TrMtUJtFVl 5D6t+VgZJ71wj4g6z26CrXrAPK1Cu5TKfDxTSAUTFjeVLCQVvhoUL41M7S/Ju2Jdit91 yJN5RA2XY1tE62A2DMVJk+M7QGa2Zo16Uc65YDa2BguC3g0IGzHQJ1XIXfQiqo4z0FnG RN8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si7237565eju.478.2020.05.04.12.11.31; Mon, 04 May 2020 12:11:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbgEDTKK (ORCPT + 99 others); Mon, 4 May 2020 15:10:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:60780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbgEDTKJ (ORCPT ); Mon, 4 May 2020 15:10:09 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 447F8206C0; Mon, 4 May 2020 19:10:08 +0000 (UTC) Date: Mon, 4 May 2020 15:10:06 -0400 From: Steven Rostedt To: Joerg Roedel Cc: Mathieu Desnoyers , linux-kernel , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Borislav Petkov , Andrew Morton , Shile Zhang , Andy Lutomirski , "Rafael J. Wysocki" , Dave Hansen , Tzvetomir Stoyanov Subject: Re: [PATCH] percpu: Sync vmalloc mappings in pcpu_alloc() and free_percpu() Message-ID: <20200504151006.69d2a16c@gandalf.local.home> In-Reply-To: <20200504183832.GL8135@suse.de> References: <20200429082854.6e1796b5@oasis.local.home> <20200429100731.201312a9@gandalf.local.home> <20200430141120.GA8135@suse.de> <20200430121136.6d7aeb22@gandalf.local.home> <20200430191434.GC8135@suse.de> <20200430211308.74a994dc@oasis.local.home> <1902703609.78863.1588300015661.JavaMail.zimbra@efficios.com> <20200430223919.50861011@gandalf.local.home> <20200504151236.GI8135@suse.de> <20200504134042.178409c3@gandalf.local.home> <20200504183832.GL8135@suse.de> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 4 May 2020 20:38:32 +0200 Joerg Roedel wrote: > Fair point, but this just shows how problematic it is to call something > like vmalloc_sync_mappings() from a lower-level kernel API function. > The obvious fix for this would be to make pgd_lock irq-safe, but this is > getting more and more ridiculous. Yeah, it's just getting more deeper into the rabbit hole. > > I know you don't like to have a vmalloc_sync_mappings() call in the > tracing code, but can you live with it until we get rid of this broken > interface? I'm fine with adding it to the tracing code (with that ridiculous comment! ;-) I'll even tag is as stable, but again, it's uncertain what commit that it "fixes". > > My plan for this is to use a small bitmap to track in the vmalloc and > the (x86-)ioremap code at which levels of the page-tables the code made > changes and combine that with an architecture-dependend mask to decide > whether anything needs to be synced. > > On x86-64 the sync would be necessary at most 64 times after boot, so I > think this will only have a very small performance impact, even with > VMAP_STACKS. And as a bonus it would also get rid of vmalloc faulting on > x86, fixing the issue with tracing too. Just because tracing get's a workaround, let's hopefully not get distracted and forgot to add this. It looks like the best solution is to not need the vmalloc_sync_mappings() call in the future. But, as we are about to release trace-cmd with a feature that reliably triggers the bug, I can't wait for the proper fix. -- Steve