Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp100867pxf; Wed, 10 Mar 2021 01:17:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHsZHPhkadge9nboRRuaiofDPMbiv9pkeIzAtJeXcPkRY5b7qWLAQFrSJg7xfNXw8InCDw X-Received: by 2002:a17:906:2e08:: with SMTP id n8mr2541662eji.527.1615367842996; Wed, 10 Mar 2021 01:17:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615367842; cv=none; d=google.com; s=arc-20160816; b=RWTgZqX3pivQVSiZNbXEazPQQtM5i7JG1loZYlD8YTD6h/7yOzc50vFdbS3MnfOoDl 6zBQUDyCgmfb9c0roayjY5isZHwfTuLHB5xECCEuxht5L4T6hIXFU4+c0YqFEIs32gcG EkTje98bLJAs2V2zhB2pVd+7LT3BGMwZBlHxtUAAIq4d/jsIRGgjWH4IyTm5ojZrCgS6 BLZY7kI6lD1gXfwz629Fk/o4+sYYTKYuiUVJQ/UIurycajd+6iIhF5NUK+qYnbCq5PIZ /vjjIS84kS4sV89O8i6aGHynuRZakNSc2uOQqZQ+X4tklejvaVxaSvHJC0uXKtekBsux hihw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k6edGbn+vPekoJZII3mMJI4xd+2gj/4sv7pPUzi5WJQ=; b=vxucJe6dnI8fimT95/2waEBbJDJMLs+BW2lmJRKuXX2wrYZObfoBujvQGYScue0Odt X0/soYPXywl0/cq9bu+t01Al5/EaZSH2PNd/oMf33WWtWwgCvsowtz71Ag5rwtV170dv 0CN+/aTPi1mM9BW0esxhgfunbiXxhgaENdrmZ008/lVIhyKE37Vn+E7qTgJMw3rv7JKk /6Cn49jl8M8nug0v15ePbhFQ3swUI0cnM/EzLAkQIHVG4MoqQTQFU2us/E7cEKSyusf8 BXweaSlezOJOIgb2nksISukB3plka4aJSk5Mdq1vZOk2+dmDHVdXQM2cEplI1hsIPnvP OExA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=E+pee9Wz; 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 e24si10964083ejc.739.2021.03.10.01.17.00; Wed, 10 Mar 2021 01:17:22 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=E+pee9Wz; 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 S231572AbhCJJPN (ORCPT + 99 others); Wed, 10 Mar 2021 04:15:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232519AbhCJJOm (ORCPT ); Wed, 10 Mar 2021 04:14:42 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA76AC06174A for ; Wed, 10 Mar 2021 01:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=k6edGbn+vPekoJZII3mMJI4xd+2gj/4sv7pPUzi5WJQ=; b=E+pee9Wzo/fkYoZEG9bnxWp6Y5 +X0RI9Dw8d0Z0VhOUeYm8BOR3qHGIh22jonj0bFCzvyxeayNykc+E65iWrYRNook76NbFqVCjLE85 pktdK6JOLt91pqLcCZyO/sU3zKXZElqKWUL/Dx5Aw3FPIY/trqPdW8XNN8I5mvH3J8a7I3eHehKdQ qm5pBJP6/qusrt6vbv9sd1y3Q8E87cdL/fPMBv89KlhuDzqKsVRyey177OPA4mJf8pqpQvrB9HUX5 DOuin804TdfZOf/DTARSIddf4DU3UvnOsUkDkcq912S6EUscK+/V2ocLFAlfP+mO86Yx7Bs29m4Mz U2mPCM7g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lJuvM-006RQg-QT; Wed, 10 Mar 2021 09:14: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 CCB71300455; Wed, 10 Mar 2021 10:14:35 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4D4222B7F3E94; Wed, 10 Mar 2021 10:14:35 +0100 (CET) Date: Wed, 10 Mar 2021 10:14:35 +0100 From: Peter Zijlstra To: hpa@zytor.com Cc: Steven Rostedt , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: The killing of ideal_nops[] Message-ID: References: <20210309120519.7c6bbb97@gandalf.local.home> <362BD2A4-016D-4F6B-8974-92C84DC0DDB4@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <362BD2A4-016D-4F6B-8974-92C84DC0DDB4@zytor.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 09, 2021 at 04:33:45PM -0800, hpa@zytor.com wrote: > On March 9, 2021 1:24:44 PM PST, Peter Zijlstra wrote: > >On Tue, Mar 09, 2021 at 12:05:19PM -0500, Steven Rostedt wrote: > >> On Tue, 9 Mar 2021 17:58:17 +0100 > >> Peter Zijlstra wrote: > >> > >> > Hi, > >> > > >> > AFAICT everything made in the past 10 years ends up using p6_nops. > >Is it > >> > time to kill off ideal_nops[] and simplify life? > >> > > >> > >> Well, the one bug that was reported recently was due to a box that > >uses a > >> different "ideal_nops" than p6_nops. Perhaps we should ask him if > >there's > >> any noticeable difference between using p6_nops for every function > >than the > >> ideal_nops that as found for that box. > > > >If the machine is more than a decade old, I'm not really caring about > >optimal performance. If it is 32bit, I really couldn't be arsed as long > >as it boots. > > p6_nops don't boot on all 32-bit chips. Sure, but we can have one set on 32bit and another set on 64bit. $ cat nops.s .section .text nop1: .nops 1 nop2: .nops 2 nop3: .nops 3 nop4: .nops 4 nop5: .nops 5 nop6: .nops 6 nop7: .nops 7 nop8: .nops 8 $ as --32 nops.s -o nops.o ; objdump -wd nops.o nops.o: file format elf32-i386 Disassembly of section .text: 00000000 : 0: 90 nop 00000001 : 1: 66 90 xchg %ax,%ax 00000003 : 3: 8d 76 00 lea 0x0(%esi),%esi 00000006 : 6: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 0000000a : a: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi e: 90 nop 0000000f : f: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00000015 : 15: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 0000001c : 1c: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 23: 90 nop $ as --64 nops.s -o nops.o ; objdump -wd nops.o nops.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 : 0: 90 nop 0000000000000001 : 1: 66 90 xchg %ax,%ax 0000000000000003 : 3: 0f 1f 00 nopl (%rax) 0000000000000006 : 6: 0f 1f 40 00 nopl 0x0(%rax) 000000000000000a : a: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 000000000000000f : f: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 0000000000000015 : 15: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 000000000000001c : 1c: 0f 1f 84 00 00 00 00 00 nopl 0x0(%rax,%rax,1) --- Although I would use DS prefix nops for 32bit nop5/nop8 to keep them single instructions. Then we can do away with runtime nop selection and special atomic nops and simplify things. All this runtime faffing about nops is tedious and causes complications we can do without.