Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3678297ybc; Thu, 21 Nov 2019 11:59:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzGdBdYP+dMKKn4fGLxDS8GVUFhJo7EVoVlFy6QDrykd8FphUjkjrYgMNP+DnSNn9TQwGLV X-Received: by 2002:a17:906:601:: with SMTP id s1mr16220687ejb.287.1574366384314; Thu, 21 Nov 2019 11:59:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574366384; cv=none; d=google.com; s=arc-20160816; b=kUQocXTwbS0MZ3t/1mKwl5i+ND89Ft0lcqHRzvEk2o5ZMRuJE+NT7YYNHngvYswP75 btz1kXdnMupg7I2y1KET7m2JTECN7vDNNWV/2R9bmAuioTxN2HrDctmCa+cd28Ie0ZIL /VNzxcS67fThtXlXz0PaaRcs9JBteSczHkZ6LVbPrvcp0UpRwzdPNthgEep+i4aNRDAJ YnSExWoXK3X99AG/3LLeOVr2RNJQWou5fS8okoBwjMMRhW2sulMf+YLqEu1Hg0grR3o9 j7wqLqUPqcO+8kWsfgbAmMa+tr+c2AKjm0ru2vJHtfpjI9VCHjsehOTivNuXNamVbQHd MZ6g== 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=ERsW0Ec/9CwlIdkx+SUdsqC89v+sCvHHndKM+e+JZ0A=; b=vO6sIU1AMNexQW24ajTRBQp5SdcDBJHBM5XuGjC54oTNKl6KslQNHSO0XnFIGqRWLB rAyABi5R7uXcSpFp6ir3qNiUjhKw3O83ugszHGL7Vrs/sYUWkmVZcwXVinnjltW4kI1f rb30W2WF61qGEA7EkhhqHKmlhqu4KukKe3xSAiG9ybizUmY/48BGORChZ/V8K/SvRLOY 714G1JzbjGyq9RGGoi9ktbOZ1i1M/fUQXMgBpZttEKTDpnOJKeX2ipvf53w4NZ9+eB7w 3LHrPXlK4oojP5zXk1PTeryEEVpvH9U0WSo1naHjzHvKhUdDZ3SgDHFNUWBE5RXWcD/O B4DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=LuUMK8z+; 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 s10si282322edh.138.2019.11.21.11.59.18; Thu, 21 Nov 2019 11:59:44 -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=bombadil.20170209 header.b=LuUMK8z+; 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 S1726803AbfKUT4m (ORCPT + 99 others); Thu, 21 Nov 2019 14:56:42 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:39160 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbfKUT4l (ORCPT ); Thu, 21 Nov 2019 14:56:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=ERsW0Ec/9CwlIdkx+SUdsqC89v+sCvHHndKM+e+JZ0A=; b=LuUMK8z+PevXS6cF+os4NkDlC 506kjmh4SjZUrlkWZm7qP9BB6eWjB/YCZ6KaMlwSpfYvnGcGwb44g6NY4p6za+w/EFoCIPXrq/aYQ pnBZ+y30Jj1bZUOfWtTPTvrQ+5H0oP+edq5C8ze/Ic8iIjdXp8ntx7zGaWQa7MDKTKVzaj6ennpOA D703KJ4frxgEKkXBX/qg76YSML5Cwn71rTntlmbryRfvHEt/qzypVWwQKpwkxNIde/ZuZvlXHvKnS XfWA0nbnUqczJ1bClAXo0kvC1TLyFnZ6eNHTHz9vJXQzItXnNMhZ0WdvZCh5sRa5JXJetlFz+y3wn mq2wtRjcw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iXsZA-0000kZ-KF; Thu, 21 Nov 2019 19:56:36 +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 81FF2300606; Thu, 21 Nov 2019 20:55:23 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 795AD2022FCFB; Thu, 21 Nov 2019 20:56:34 +0100 (CET) Date: Thu, 21 Nov 2019 20:56:34 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: David Laight , Ingo Molnar , Fenghua Yu , 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: <20191121195634.GV4097@hirez.programming.kicks-ass.net> References: <1574297603-198156-1-git-send-email-fenghua.yu@intel.com> <1574297603-198156-7-git-send-email-fenghua.yu@intel.com> <20191121060444.GA55272@gmail.com> <20191121130153.GS4097@hirez.programming.kicks-ass.net> <20191121171214.GD12042@gmail.com> <3481175cbe14457a947f934343946d52@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 09:51:03AM -0800, Andy Lutomirski wrote: > Can we really not just change the lock asm to use 32-bit accesses for > set_bit(), etc? Sure, it will fail if the bit index is greater than > 2^32, but that seems nuts. There are 64bit architectures that do exactly that: Alpha, IA64. And because of the byte 'optimization' from x86 we already could not rely on word atomicity (we actually play games with multi-bit atomicity for PG_waiters and clear_bit_unlock_is_negative_byte). Also, there's a fun paper on the properties of mixed size atomic operations for when you want to hurt your brain real bad: https://www.cl.cam.ac.uk/~pes20/popl17/mixed-size.pdf _If_ we're going to change the bitops interface, I would propose we change it to u32 and mandate every operation is indeed 32bit wide.