Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp994075lqg; Sat, 2 Mar 2024 10:07:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWfZCRZvnlRNz1HvmaTd/jei19zEr+lgN0IOz5X58NV56n664cu+42UJ5M4IpGZbwjhWV3Hk0QtmSYdLIFybVXRCD5YqwgXzbrW23nRvQ== X-Google-Smtp-Source: AGHT+IHOinnlhiLrQKT8Oo31403O2NRmpspgSPoqIpSGQlKVCMsv0nq9x4tw0wjclaAbc3TZu5rE X-Received: by 2002:a2e:bc14:0:b0:2d3:364c:261d with SMTP id b20-20020a2ebc14000000b002d3364c261dmr4519915ljf.6.1709402859550; Sat, 02 Mar 2024 10:07:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709402859; cv=pass; d=google.com; s=arc-20160816; b=hGy+hxPtbBUa/1FOd8V8I3vmM91UgkDOLyyjihEb1cVBAGtubrJQik6utld2AGG/pg jgxfmlWf9okB6nJideEzPVFbCrJOLdpyuXLq74e0a8l2tPqRuzv5W5oTmwjtu19oKIJY 44g4TtSO9vpsshTFujBYJonajZYtlA73p9ue+FE/yAs1cLsGpZuJywRCWHfwupj+5YGa qNGOiWfqwSapHmganjXPlt40XV4f3XSsiiDQDBFUHw9Qoin19F3mpeCJovtV1e7zcRf3 eYPUKXT/RLHjvy7L28fY55KNmviL1S1SrunBife2EQofDq3z9j6t+VB0sVuYk6032W3k PofQ== 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=tgHiAUIVGDD+1DgrVyftk8s8h5JugoTCX2MAvO9xGEU=; fh=Z7jmrSC0PwPRKvI6PAmvWg2INgjdjJLFhUwBxqaOc64=; b=0YBcjQ8l9N/pwhYyDfZopK80haoCQa1QpQoGYUiht2fnserx+TjunssSETb+QHRLMP 4JLT1bLzg93JuRoLHoTxkBWN+7S47ry57mcDNWy5f9CCRGMurl+HbkhGn3VNaG++DBzz c2D+Vqw0IBp41vNEq4emUujJ9/kDY5iyIctEHzsu8gkJvAvttbIKNjeuOaLZaWFTPE/6 GRFnKyCOw7o9LP8hkfEbYQ3WPPoHpmuyPntzfwvFzrnqQUOApd2LuUgZrnoe9S1CBFEq aeWCVrLUPDAMTp1LcMTCn8wTzMD0lCWktMSfoOdc+na3WtWbAqJlINBM+d8jLmGki4iK JV2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="Wh/jWORG"; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-89543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89543-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i5-20020a50d745000000b0056601e9fbacsi2568974edj.616.2024.03.02.10.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 10:07:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="Wh/jWORG"; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-89543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89543-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 05BB51F21C85 for ; Sat, 2 Mar 2024 18:07:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6D2A364C2; Sat, 2 Mar 2024 18:07:19 +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="Wh/jWORG" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 1586B2C6B3 for ; Sat, 2 Mar 2024 18:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709402838; cv=none; b=HZ51p0wLg8TObQ6UZVxVsZdFotRTABQgcxiHQ3nkBlPqWbHpDKWV7xFrEmyQRBvqL3YG+E6PbHIwrTSHuQ63/FYNa1SMlbW9nO8SiccZJIUa0V0wndSLjWCoWtsUFzFZ+aTt+mstRy1nLcklZoyh8Oo6nN64II1ygmRhm2NNq1k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709402838; c=relaxed/simple; bh=oPp+kEJm2yuQWRduHCnpZa6W+Rr0cKGzx+MpiFA+B7A=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=QaKGSSiFHlSGBFaDaL9mC0oaZ6yFBCEVPPu3p0XsgDFoSdZaCcdDG932d7KbBoDzGZFxJ250B+wG7LzPOORLv6fCCyOBxUiuqZ5tkj/195fQO8XBJPLTBw4iibT9oUEwooRrJ2LjgfkXnnCdUpZrkrPwhpaqQP4hS7NIQBlY9m4= 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=Wh/jWORG; arc=none smtp.client-ip=209.85.167.49 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-lf1-f49.google.com with SMTP id 2adb3069b0e04-5132181d54bso3394987e87.3 for ; Sat, 02 Mar 2024 10:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1709402835; x=1710007635; 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=tgHiAUIVGDD+1DgrVyftk8s8h5JugoTCX2MAvO9xGEU=; b=Wh/jWORGx7nG2fLYaVIuzhWcnwjSYYueizRf/R+Drp+3l6X985YI77UnPwgupYN6Xg v3eVSgw2mJRw8MowCgYoEh2vAv9DVkGjrzur+YISvlnnhZ/j+RXFun7ho3nMHOmTWwaB jDPV9F6/4rVBIQmXpe6a2OcQ5QWjbNidmzvUw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709402835; x=1710007635; 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=tgHiAUIVGDD+1DgrVyftk8s8h5JugoTCX2MAvO9xGEU=; b=Zo+WWXhOfBq1koBbadpm/cnV5wdlWvQDoMauiIrP59/F3yy+53K7uZMvoW3YQ8ejhy QF7K4Phc2TIOt5trY0Zc8V6br4oIkCOyImf59sOnVGq6nalbscpJHq5+nk0tcnaE6WKG vyKYSympCNefQafmTNRZHNnL9e9KwnmgvPe7/z9rqPnWKEerbu1u4P/SjoyclVLN7sCB D2CHoKt621cAtMO5GsjTUnHv40djsu6wZ9j1U4SHM7fGTiSJwDhlyKElOSheyBsggyXN KHN/o+wz0j8x1ek+R0mPGAk7U4HaY7BShhN2ZxcM8Tu5HXxhoRpLT9oP0WSSiOj3899c vlyQ== X-Forwarded-Encrypted: i=1; AJvYcCXgypEFC+DcgBAMyvBegTPH7gQRJf40utf0BGcPSQxXTAW5LPQ6+hwmzIicqzzOMSJiqoND5v4up6mRcIbZTi5nHA67x17tRXTnLD3/ X-Gm-Message-State: AOJu0YxSSLVV5fixslDpH8+rRqptG1D3kUhHm4aD63J9QbFAf/iYw1kx X4mcgqLjrn6PjUrm3MqMgfRUhVZs9QTDOK96jGGBl7169Rpsml4RtRaOTm0B/+abRedoJBHQ5n9 rK0oPPA== X-Received: by 2002:a05:6512:4027:b0:513:2992:bda2 with SMTP id br39-20020a056512402700b005132992bda2mr4789318lfb.5.1709402835062; Sat, 02 Mar 2024 10:07:15 -0800 (PST) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id mp7-20020a1709071b0700b00a440ceb4110sm2952095ejc.183.2024.03.02.10.07.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 02 Mar 2024 10:07:14 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a445587b796so338444766b.1 for ; Sat, 02 Mar 2024 10:07:13 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUWJZkn5UpMKepT0brgRIBd+JC4mYYJM7HQ+GsAa0xcD5lpF8T7KvL2kGcAIy2JJxtLjgu1K8TnOiZdix/1l4es+QCoLe+gUN+p0EhT X-Received: by 2002:a17:906:2c53:b0:a44:f370:e2ce with SMTP id f19-20020a1709062c5300b00a44f370e2cemr785292ejh.16.1709402832627; Sat, 02 Mar 2024 10:07:12 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20230925120309.1731676-1-dhowells@redhat.com> <20230925120309.1731676-8-dhowells@redhat.com> <4e80924d-9c85-f13a-722a-6a5d2b1c225a@huawei.com> In-Reply-To: From: Linus Torvalds Date: Sat, 2 Mar 2024 10:06:56 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [bug report] dead loop in generic_perform_write() //Re: [PATCH v7 07/12] iov_iter: Convert iterate*() to inline funcs To: Tong Tiangen Cc: Al Viro , David Howells , Jens Axboe , Christoph Hellwig , Christian Brauner , David Laight , Matthew Wilcox , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kefeng Wang Content-Type: text/plain; charset="UTF-8" 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). > 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. 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