Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1708504lqg; Mon, 4 Mar 2024 00:53:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVzAKKX61GnZUrHi+3blLothu5l+LAqo0qogz/nzwOUUy6Bvx11j7ESXU+7H2+pc1RVgkrS6tnB2E7OrqTmtSeGohHP2XDGZ3dqUJNS2Q== X-Google-Smtp-Source: AGHT+IFevCRZlcZtCbG4P8UtU0OBOzMncxnI/xKbwadIryQKVQOnpRCOiBrlf5lwoqvdOoE1jw/Q X-Received: by 2002:a0c:b4d2:0:b0:690:49b0:cdff with SMTP id h18-20020a0cb4d2000000b0069049b0cdffmr11750822qvf.24.1709542382117; Mon, 04 Mar 2024 00:53:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709542382; cv=pass; d=google.com; s=arc-20160816; b=vZuXOd34UZwWbY9uIfl2UI7Aa3a0tSZ9bR7pgwrFV6lr/mYbcveB7uLaPoev4l6Kja qdACwLb/nj0yNQxLbSMwHgLxJhb4YBfFpNH3OlQtZSRhFyb06I3D1zlXm+MOH9fhgtqT OItKw0+cZ+5BHY1nWSMqKSH6iy0lMXZMz06OB701ruu8VhMCQBudlXZsxrdXKEMkEq1I BKysnYJCDLNJO4Gvc6HQr5bWoTGHhLR4wmRiYf8sXuuS3p4h9W/V+fRzuWF3YxMrkOwn 9XbXBz+woitRnMn577QbIB7+ezDbSP0aBFNbuBH1gV6u8E5Yqu8s/cZLMNqywImLIH0s TXyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=OCDBGDkz2tLdAN5KOFiloZHr8ehyPDliPED+0SW7RQk=; fh=K03/CVX9jfELsojlvBQigkCRPAybdgrarA9Cn+VLTt4=; b=p8QlgL2k2QyFeQY0rE2O8VtQLmiMiACUmz5Rg0bacu+F2hZzoBQcj7e94RQBday5tG bJQW0t+eAibZSmDZ9/VnZU17R4z5xH3K+9BfXa1PGHm+E0IZXn5p/QrJ5+CGiHuS4fn5 b42Z4iJZ26o5tUCJ1NCBN+6z1eVOfp8AleEk9ASJXBGk7Yo0eqx/LKxbUJ8o+AbEqoot v49c3eFd6ZIQrovx06cDlkHrj7e2hgHmWxDM6MfZrITg+crKQ0rhQJSrbWKwn8wokmIr F5jgqarIkeLF1McsIPwFCsw4xjHbefdnoJuRRmb4KQy7UuelxG/ecPKpUxvg/ALwsCuO v1Ww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-90243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gw8-20020a0562140f0800b0068f3fec110csi9070589qvb.266.2024.03.04.00.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 00:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-90243-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90243-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 D60A71C21ABD for ; Mon, 4 Mar 2024 08:53:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E786249F4; Mon, 4 Mar 2024 08:45:45 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 231B7199A1; Mon, 4 Mar 2024 08:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709541944; cv=none; b=GgnErBNvJcSoMc6XysZ9/z07gAMxTiJcwP5YZy72G6rp6T4nUCSXYKXkhhiSsopUS62anULH2jaCls5O+Ol6NzKFSvT21Uls/SvBCBh+ze1U5xeuh3npNxKUWuCaupD8/AD+kfE0tYMUWFrBfG23huEmoVD8DjMFpkfWV54/xHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709541944; c=relaxed/simple; bh=3INRU0FvSF5yHYj1wch7w3hifZglrOnv+QBi8Qw0ndI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Z9afsHX2yrb2dBfMHl9TF1fy2LyQr6Lm9LawJ1VZ9YTSvjs5zid7tfBJdPbRzU/nv8oMklibHsHeH2ZxCgeFQoHweJXDExq7skw2GA0QkngIyqH0A1hpEQYxIA0a0xmvASfhU/TL9qAUed0mwkmh3RE0UkzeaceLnkhbuSNFmYg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4TpC0X6tGKzNlpP; Mon, 4 Mar 2024 16:43:56 +0800 (CST) Received: from kwepemm600017.china.huawei.com (unknown [7.193.23.234]) by mail.maildlp.com (Postfix) with ESMTPS id CF891140415; Mon, 4 Mar 2024 16:45:32 +0800 (CST) Received: from [10.174.179.234] (10.174.179.234) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 4 Mar 2024 16:45:31 +0800 Message-ID: Date: Mon, 4 Mar 2024 16:45:30 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [bug report] dead loop in generic_perform_write() //Re: [PATCH v7 07/12] iov_iter: Convert iterate*() to inline funcs To: Linus Torvalds CC: Al Viro , David Howells , Jens Axboe , Christoph Hellwig , Christian Brauner , David Laight , Matthew Wilcox , Jeff Layton , , , , , , Kefeng Wang References: <20230925120309.1731676-1-dhowells@redhat.com> <20230925120309.1731676-8-dhowells@redhat.com> <4e80924d-9c85-f13a-722a-6a5d2b1c225a@huawei.com> From: Tong Tiangen In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600017.china.huawei.com (7.193.23.234) 在 2024/3/3 2:06, Linus Torvalds 写道: > On Sat, 2 Mar 2024 at 01:37, Tong Tiangen wrote: >> >> I think this solution has two impacts: >> 1. Although it is not a performance-critical path, the CPU usage may be >> affected by one more memory copy in some large-memory applications. > > Compared to the IO, the extra memory copy is a non-issue. > > If anything, getting rid of the "copy_mc" flag removes extra code in a > much more important path (ie the normal iov_iter code). Indeed. I'll test this solution. Theoretically, it should solve the problem. > >> 2. If a hardware memory error occurs in "good location" and the >> ".copy_mc" is removed, the kernel will panic. > > That's always true. We do not support non-recoverable machine checks > on kernel memory. Never have, and realistically probably never will. > > In fact, as far as I know, the hardware that caused all this code in > the first place no longer exists, and never really made it to wide > production. Yes. There is a low probability that the newly applied memory is faulty. Thanks, Tong. > > The machine checks in question happened on pmem, now killed by Intel. > It's possible that somebody wants to use it for something else, but > let's hope any future implementations are less broken than the > unbelievable sh*tshow that caused all this code in the first place. > > The whole copy_mc_to_kernel() mess exists mainly due to broken pmem > devices along with old and broken CPU's that did not deal correctly > with machine checks inside the regular memory copy ('rep movs') code, > and caused hung machines. > > IOW, notice how 'copy_mc_to_kernel()' just becomes a regular > 'memcpy()' on fixed hardware, and how we have that disgusting > copy_mc_fragile_key that gets enabled for older CPU cores. > > And yes, we then have copy_mc_enhanced_fast_string() which isn't > *that* disgusting, and that actually handles machine checks properly > on more modern hardware, but it's still very much "the hardware is > misdesiged, it has no testing, and nobody sane should depend on this" > > In other words, it's the usual "Enterprise Hardware" situation. Looks > fancy on paper, costs an arm and a leg, and the reality is just sad, > sad, sad. > > Linus > .