Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3705798ybc; Thu, 21 Nov 2019 12:24:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzYpwEWOaiLHlxXmUtIoEV49faUFIGVDgCmvNbE5gNiVkWYkw52zreiPoQZ5JcNvnKq03lX X-Received: by 2002:a17:906:32d3:: with SMTP id k19mr16115641ejk.75.1574367854624; Thu, 21 Nov 2019 12:24:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574367854; cv=none; d=google.com; s=arc-20160816; b=MN6Q6i8EagwAb6b4pZvRRTuoSe2+epQhYFJKvapqTuZbs7czECcydnKQ43qISQEY4o G5zFH8JjL5ieL1N35MxjyUKvJiF2TvyD6LLru60OuEiLjA5NYyXfjR6xy0RrL0fva0gK Vx4BcHA6diGL/eJMIoNBfrlCYyzzRMLgcyyVu/FwyPj8IfTTHaBzFH6TickXNvHkU/v1 xebKUg1MfNuJcdzy+K4KTzhwrTXkCgBIa+PL1kBVwEJZ90AIIR4dxt6OjWhmlNCRS/nR Pmls3Xy4E8zEbvJoXuNTdvLgGCnfyHjgopoH/P2ptSlAGETh7QupnR7b0vIPdzBXWt6h oupA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qOktCdLLVB7nTmJcxwH9iwxLQvm6tnAzKuSohvP2NxY=; b=ejFfdJgRwZk7lUt8MAZSenDwb57S15s/vgcY6ixb1LBflCBKgVDArbVlp8KnUMlHQd wYk0oyRwbifeyipHOD38WaUIrAJgbpHRLruq3CpQwQ5EozK7UuqevQptzJXhzG6xOO7S NSuBYJiJOpqkKoaOZAgWbHKaoGqNQhQHxIodmN8hpMbhP2r8Jke+MieQmWbWmgD3T9Bs W3INcml1fwKVED5npJSF3ZPWOgd5SAK7oyRS/K/5Fcw4dlZX2GXeQRNZ9zQv+TzR4pqm BhLde6jo2ApzaVzNbF7RR2qRNL0OWaUG2nkwJh5L0OM+kTB3l1k7Ohyvy6/L6xmOEiI1 GhoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=QKqJyLmM; 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 o19si2590515ejc.315.2019.11.21.12.23.49; Thu, 21 Nov 2019 12:24:14 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=QKqJyLmM; 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 S1727096AbfKUUUH (ORCPT + 99 others); Thu, 21 Nov 2019 15:20:07 -0500 Received: from merlin.infradead.org ([205.233.59.134]:58896 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbfKUUUG (ORCPT ); Thu, 21 Nov 2019 15:20:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qOktCdLLVB7nTmJcxwH9iwxLQvm6tnAzKuSohvP2NxY=; b=QKqJyLmM0ryi+pVTsX9E5xBDo 1LT0g4qnkID9F1BatrY2Fz0Kcu9yWX72F6OGoAmH2zebp/uh9sBEY4AZCOC89AB64baY+GxFV28Jn bELXaEPnDl0G9RI/iq8xeOVyUReRHZ4hCdqB7cZsi219jx4Qy9U+DbkZfZKlYxTjE6Xzx/QCmtMFP 5jfbOIL4yvZUlW3q99MxBFAwm/di7EVk1AJsOz5/vbLc19jBUZnRWhrqqiiIAGeeClSa4wqJt4cth JWjx6oaz8wR987r13sC3BYbcJNlrP4bfCeFCDkVeyAetAPEtUyAXFIB0qIiNf8m5a0vw8E2PWEXJF 7+PTGMpFQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXsvh-0000l2-QH; Thu, 21 Nov 2019 20:19:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1EF1E300606; Thu, 21 Nov 2019 21:18:40 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1D64A201F87D3; Thu, 21 Nov 2019 21:19:51 +0100 (CET) Date: Thu, 21 Nov 2019 21:19:51 +0100 From: Peter Zijlstra To: Fenghua Yu Cc: Andy Lutomirski , Andy Lutomirski , David Laight , Ingo Molnar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Tony Luck , Ashok Raj , Ravi V Shankar , linux-kernel , x86 Subject: Re: [PATCH v10 6/6] x86/split_lock: Enable split lock detection by kernel parameter Message-ID: <20191121201951.GY4097@hirez.programming.kicks-ass.net> References: <20191121185303.GB199273@romley-ivt3.sc.intel.com> <4BB1CB74-887B-4F40-B3B2-F0147B264C34@amacapital.net> <20191121202535.GC199273@romley-ivt3.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121202535.GC199273@romley-ivt3.sc.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 12:25:35PM -0800, Fenghua Yu wrote: > > > We are working on a separate patch set to fix all split lock issues > > > in atomic bitops. Per Peter Anvin and Tony Luck suggestions: > > > 1. Still keep the byte optimization if nr is constant. No split lock. > > > 2. If type of *addr is unsigned long, do quadword atomic instruction > > > on addr. No split lock. > > > 3. If type of *addr is unsigned int, do word atomic instruction > > > on addr. No split lock. > > > 4. Otherwise, re-calculate addr to point the 32-bit address which contains > > > the bit and operate on the bit. No split lock. > Actually we only find 8 places calling atomic bitops using type casting > "unsigned long *". After above changes, other 8 patches remove the type > castings and then split lock free in atomic bitops in the current kernel. Those above changes are never going to happen.