Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2004454rdb; Tue, 20 Feb 2024 14:02:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVPhHC1AGE1fw1bRWZvkMr9hAj2iZpeN5GFEhCjtrq0ENd045nDEUdB2yuIJjTph82zfClfqTfv8+f7TliCRx2XYdoFbU9rTQjqRCuCHg== X-Google-Smtp-Source: AGHT+IGqZ/mUdSRJlfbNMpIXiZj3kUqrzRjedM8O++kjPAEUcw4GwA+9AbtAs1cAEFppj7xiCLj/ X-Received: by 2002:a0c:f588:0:b0:68f:9fc5:aee7 with SMTP id k8-20020a0cf588000000b0068f9fc5aee7mr731955qvm.29.1708466567305; Tue, 20 Feb 2024 14:02:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708466567; cv=pass; d=google.com; s=arc-20160816; b=YCBAn3ddpi3hVwgfzJwMfwoAwkwMjj/vtcb/MDYRhZBrPPl2xvDMpYW5V682DOLWzE ASiS4+Q8kGBE8L6w+kJ9z/fxsy9Jwxqrj4oexrQKrIdVHpSNAn8wlWTr/4PyqiRYCaXr eIl1/BGQ+/oFyOG32zjVAHVm6sA8CMa52DjouH5NJCaYG4nX1e0yKqPWZAgTWjEpTzYn j7zqL5yhd31XYszNmBgJrxNlaTWPvJUKlFIC6Nv1eo06KojWvZz5jRXXYNaZfiaqCqsc Fq9s61sEFeq4YtUy+Y8HXtN2Aq/GKV0BBs1Jqmz8yIYaQGqN6txn19nEvlxp51pdP2zq B6+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=slEeVSXDAFhjTmrDFJ456REWzWzhVL5Yf7o/aFavGTM=; fh=l/WN+sK+VZJa/0UlSOjze34zNf6Hsv8tCnRg7D866gU=; b=BDPZOsLMo8+E2dBlyZyD9Uvo8pmFh0FBF6iXcIafpyipB2VmaYx5b+iuUNZQFcRdpN Xed/caRJPooU5jpxtImqx97UxtdYH4LueGCEzghnAgwpXgVCG8KMCVmnFIqc2lHMZt/6 1R/pVdzhhXzt4GTx4sbpQxxGokrSGZ0hZxX21m4lzjJzBZDa5x6dvmVMV6tb1deFtRIN AjQRK504awIWKFfglmedM0io/q+nzA6iss+TeAGBe8Plk2DDw+7GWJYCNWqjYUccY9Q0 Z+mZYYGTHnWOh0UMi72TRlnvbUfVyZKIkQ6mB9vtUL6YRh/gH7rXIIEdGnVN3zIFQJeN Nx2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZYnkq1wc; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-73740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73740-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d7-20020a05621421c700b0068f2dbe3675si3188092qvh.347.2024.02.20.14.02.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 14:02:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ZYnkq1wc; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-73740-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73740-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0B58A1C20F8B for ; Tue, 20 Feb 2024 22:02:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC4CE152DF8; Tue, 20 Feb 2024 22:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ZYnkq1wc" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE31C1509BC for ; Tue, 20 Feb 2024 22:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708466560; cv=none; b=mcCHvEPDCMayjCR3UdK+9MI/JDuckPT/pbzzSt43z5soyxj9P7cBAnJmTtkP1TFUBBBTNQGmMbK8/BqP1mygX3B9hzEHKxatIEsB8rUu6kDGMmWG5qhl3pfgvGvaWkAnN4edrkbt+3j3UVEpjgQTAqhIBEaRmxnofHiPI55GIUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708466560; c=relaxed/simple; bh=7PluGDCDtKu4/hPc6/QUsqMWDX/isTVfpEnm7NW272o=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JKJcPzVvjC1VU2oofR03DBLDlqlliqXXkqfPrmDj6hE46iamrcXr6XiFMwiP7Imp5aXTe60S17Ojcx/WQeETsAaLS+E/xvGQHFlU1K1fn/sKntE5iwgfJQ+mHXqrakjyPtzDffbzXktUph8ykGbvcpRpD9bTCvXa2rFbqI3m6T0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=ZYnkq1wc; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a3ed9cae56fso334621266b.1 for ; Tue, 20 Feb 2024 14:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1708466557; x=1709071357; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=slEeVSXDAFhjTmrDFJ456REWzWzhVL5Yf7o/aFavGTM=; b=ZYnkq1wcWJ/t6r6rBi4f3taQDGswEXi6GVTvqhdK++RgsjSwCnUPowMQKL3TtstBXU 1xp7JyYE7pbpZFrXl9LU1MGXUa9n657ZTjOianiQ50VbwxjA9t7NQf+naXkP9aKBcFle IaPT+42FSCcgUOw5MIvQSq4X9sa7s7UhBtv3Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708466557; x=1709071357; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=slEeVSXDAFhjTmrDFJ456REWzWzhVL5Yf7o/aFavGTM=; b=c8aVTAuPUzSH4ymt5nY0+t/JW8eefCDHFRknPV5Cfh2gwF+haqetAKI2dBnpeCUCTU GoEj7CS6lNiMndzBpNQvMY92mHGYDetXg/0forfDMCaW2/d8Japc4aRxi7O44YXmcefd JL910xqWyYIibHUHQX/6WEEboy6UGxMjxQTlG2Qd1JMbJnWEjuFD4Da197h9r+ZcqZ9d K6jydUVaafvB+sM0MHC55KfBs6S3iDRG2YxcRSCJSu7oO0xLj+Rfs+YqMQ/tlH/o9n79 bga78V/6IQsKUlFggZe88ROHRwQBz2ImlLgnIOSNZg/+KcCZlSvVOuClzPjY3nSRfBze o1Xw== X-Forwarded-Encrypted: i=1; AJvYcCVCkNjX3RocmQLHPS20PymDIboMUI18H0ssbBI+NHAM4K8ZxIOB5zpZAvT7S2q0y/HZu5KtIUQ8xrGl3/ciVWaIhtkK8Au8F1tIlili X-Gm-Message-State: AOJu0Yz2FzYWNFqRQt0cSMDXLIs4q4+u95UVGk5//UqQkXiktybJjMTL 9O0lJsjCoPH0Sn9ZktqCFVrZXV7cmEzZJ9+KT9dRLbReUdzy1Mw8qLyZR7gWaBP+4F6zs8iqbBV q3IzUdw== X-Received: by 2002:a17:907:7ea9:b0:a3e:b57f:2b8a with SMTP id qb41-20020a1709077ea900b00a3eb57f2b8amr6412888ejc.10.1708466556774; Tue, 20 Feb 2024 14:02:36 -0800 (PST) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com. [209.85.208.47]) by smtp.gmail.com with ESMTPSA id lc26-20020a170906dffa00b00a3e7cb91865sm2785428ejc.121.2024.02.20.14.02.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 14:02:36 -0800 (PST) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-56454c695e6so4541252a12.0 for ; Tue, 20 Feb 2024 14:02:36 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU5ohOY91SKAfI5CcxWmSQJbkRs1iyEgAqRd6cZCf5uJd1Sr62/yiELqyR3dM3pukIF542on9AVJw0R0an/fIWY4b9cqgc5O9yZ2DQa X-Received: by 2002:a05:6402:2cd:b0:564:e568:d1f7 with SMTP id b13-20020a05640202cd00b00564e568d1f7mr1009612edx.6.1708466555950; Tue, 20 Feb 2024 14:02:35 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <538327ff-8d34-41d5-a9ae-1a334744f5ae@roeck-us.net> <2374eaeb-fa34-44b9-a945-2cd871aacf7b@roeck-us.net> In-Reply-To: <2374eaeb-fa34-44b9-a945-2cd871aacf7b@roeck-us.net> From: Linus Torvalds Date: Tue, 20 Feb 2024 14:02:19 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Linux 6.8-rc5 To: Guenter Roeck Cc: Matthew Auld , Arunpravin Paneer Selvam , =?UTF-8?Q?Christian_K=C3=B6nig?= , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" On Tue, 20 Feb 2024 at 13:48, Guenter Roeck wrote: > > Turns out it wasn't this code, but > > > Now, the __moddi3() is a *bit* more reasonable, because I assume it comes from > > > > int slot = i % 3; > > this code. Yeah. It's still the kernel doing silly things for no good reason, but a compiler can certainly do a small-constant 64-bit unsigned division without actually going to the expense of actually doing a full divide. For example, in this case, because 1**32 mod 3 is 1, you can literally just add the high bits together with the low bits (with carry), and do a 32-bit modulus. And in fact, you can then turn that 32-bit modulus into a multiply instead, avoiding doing any expensive divide at all. And gcc knows to do all this. I *suspect* that the failing architectures end up not having a 32x32->64 multiply, or maybe they just don't have a very good machine description, and that's why gcc failed on them and just ended up doing the stupid thing. Regardless, our kernel code was just not good. It should be fixed now. Linus