Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5057783rwb; Mon, 31 Jul 2023 17:39:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFPYSc0hdooThh9tCpE+RgwFmmTxkftFLIE+1tSxnbf3drobP+nWsJK0RFhr2rcccpzd0kO X-Received: by 2002:a17:902:f7ca:b0:1bb:9b48:ea94 with SMTP id h10-20020a170902f7ca00b001bb9b48ea94mr10494716plw.32.1690850398940; Mon, 31 Jul 2023 17:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690850398; cv=none; d=google.com; s=arc-20160816; b=lhFeU4lotZGsNbvpedS6IPICjNp4T0oR2JZ1gNpMCEZ/xBrz+ooljlKlJlM146iXA7 ZgjsPWIKvAJRYAd6PcgR6+YZ1Oy/G5OVrqfyNjgIeHGlVG0o1fMyLR6rRAiCOx6DCnpg xs7WrIyRrrbj9U1dH0+6e5QEVz61zpYbhlEwgrW0JheTt3oIH1c3Ohr2ypEHb4TwWIwi u2J7c16yGzD/xTT09i8w+aeLACZakZQV5N8Jgt3DDYud/luJTJkruHZ9H6fCk6HNsozQ lT1fi3/RV26VJmAXYTyBwlcOIkNEuLkZOBybJj8mS5azOXkQf67qeQ93THZBzESMBLIg +4SA== 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=Cvkb1F7VeYbirXxnx/x7mD/WcXLmaxSiQihg0hXEQQg=; fh=ROWQJW3irqLsti03Hr7HAggB7hPTmZQeRi8eGcuFpbQ=; b=ktjg2hs3OJvlsNYrwqOdw+VFun1kwAVQyUQLjvca8N9VO3baM/QZoiYDLAw7STPv+e D7VE2R7ZrBLThqIqWcW29+guupUfSN7trWu8RIC3YKj91GAsNnwBQB0fG37PrLpCD5KD Oyeh4iGvdlICO0iEacACXz8w51V7hmtdgGw7blZMmTr0fJl5SAv5prHtwQwKR2W1L7AU rjveh3a+4Xb37IvW8Ww2hSy9bZEdMvP63k/MCtGWZC5QGqCcvmDE0osKIRS+h2zEbl0e BfgTbzrHN+mLComZMTHUZqbSCoZ9FpjF8v6TdTJ7fQTcHzG5CQS6DqwEQqc64JZBN+dw dZPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="n6g/Ss/s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e16-20020a170902cf5000b001bb8a57d518si7884159plg.379.2023.07.31.17.39.46; Mon, 31 Jul 2023 17:39:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="n6g/Ss/s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbjGaVMU (ORCPT + 99 others); Mon, 31 Jul 2023 17:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbjGaVMP (ORCPT ); Mon, 31 Jul 2023 17:12:15 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A067B12B; Mon, 31 Jul 2023 14:12:11 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fe1e1142caso17827305e9.0; Mon, 31 Jul 2023 14:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690837930; x=1691442730; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Cvkb1F7VeYbirXxnx/x7mD/WcXLmaxSiQihg0hXEQQg=; b=n6g/Ss/sQPMvbjMnTYF1MCm9NoGwZgq3AjRvB60EV0FmBknxJfICpj44Pem09ppRkq qa4NY/S6KJcLWi7LxkIYsEU4g8rC5AbvkESnrRTLhmqwCwskgG8wHfk4EnCUzxvbM2MV vjjGgiW6tZ2dFXnwyr3vgm6ZVeFQJ/pgYDV5Wa+tBA6mRJ98WL1IOAORLRi6wds8DW6W N4DmL2+PAgJ9HYqR7MsGyIxV4f9u7675wZiWx/crev+xl7+uq5P4mbdsbD5uUs3cSP0b r8RwVS2Qo1oEzDTaV4BOk/2HL+2m9LbZCj3MebBKFb+ya633bL71ddA5H9aLd28l9pQW SFMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690837930; x=1691442730; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Cvkb1F7VeYbirXxnx/x7mD/WcXLmaxSiQihg0hXEQQg=; b=BdwBb7Dwjw1eGxspUbV4Gyg6ES/d/7qU866dh67m9nHkQCM/7FLFmzp7ML1UIMTQkn RQMhLUk3yXEDU2cOCVDq8HoSuG8G5uw1nOUbj6v56JMYxMI4W6sLLK+nrsbxwgz57wfJ xitDDcW7AuqaLX7A1g6nsGLGvzZVYlyJo9wwKI2GbVs0VSP8wBHnjxphvI4upBbt2w2x KoP72T3QZK6gzxFRq1ctqnBZ37cH0KKSHI06Bk52KVzBfV+Tty18R7TuPlUMU1Oaxv7b Dg7aGHRaQeyyEnpZnNbipykmMYyoz+pB+crcFD12pHnGDgq1T9DkBw1es9Wkt51IG/wI /zoQ== X-Gm-Message-State: ABy/qLZnhUxJuDeCrLYqxp3IrGK3NlQjDQOirNjeaC3QrbiYSqo/Vs0O N2f4vDGlds/cyaD9FPTGHjI= X-Received: by 2002:a1c:741a:0:b0:3fd:29cf:20c5 with SMTP id p26-20020a1c741a000000b003fd29cf20c5mr935074wmc.7.1690837929823; Mon, 31 Jul 2023 14:12:09 -0700 (PDT) Received: from localhost ([2a00:23c5:dc8c:8701:8213:500:1aa9:44da]) by smtp.gmail.com with ESMTPSA id v25-20020a05600c215900b003fc02a410d0sm14815152wml.48.2023.07.31.14.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 14:12:09 -0700 (PDT) Date: Mon, 31 Jul 2023 22:12:08 +0100 From: Lorenzo Stoakes To: Jiri Olsa Cc: David Hildenbrand , Baoquan He , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Uladzislau Rezki , Matthew Wilcox , Liu Shixin , Jens Axboe , Alexander Viro Subject: Re: [PATCH v8 1/4] fs/proc/kcore: avoid bounce buffer for ktext data Message-ID: References: <86fd0ccb-f460-651f-8048-1026d905a2d6@redhat.com> <32b8c5e4-c8e3-0244-1b1a-ca33bd44f38a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023 at 10:34:21PM +0200, Jiri Olsa wrote: > On Mon, Jul 31, 2023 at 08:40:24PM +0100, Lorenzo Stoakes wrote: > > On Mon, Jul 31, 2023 at 09:24:50PM +0200, David Hildenbrand wrote: > > > On 31.07.23 21:21, Lorenzo Stoakes wrote: > > > > On Mon, Jul 24, 2023 at 08:23:55AM +0200, David Hildenbrand wrote: > > > > > Hi, > > > > > > > > > > > > > > > > > I met this too when I executed below command to trigger a kcore reading. > > > > > > I wanted to do a simple testing during system running and got this. > > > > > > > > > > > > makedumpfile --mem-usage /proc/kcore > > > > > > > > > > > > Later I tried your above objdump testing, it corrupted system too. > > > > > > > > > > > > > > > > What do you mean with "corrupted system too" -- did it not only fail to > > > > > dump the system, but also actually harmed the system? > > > > > > > > > > @Lorenzo do you plan on reproduce + fix, or should we consider reverting > > > > > that change? > > > > > > > > > > -- > > > > > Cheers, > > > > > > > > > > David / dhildenb > > > > > > > > > > > > > Apologies I mised this, I have been very busy lately not least with book :) > > > > > > > > Concerning, I will take a look as I get a chance. I think the whole series > > > > would have to be reverted which would be... depressing... as other patches > > > > in series eliminates the bounce buffer altogether. > > > > > > > > > > I spotted > > > > > > https://lkml.kernel.org/r/069dd40aa71e634b414d07039d72467d051fb486.camel@gmx.de > > > > > > > Find that slightly confusing, they talk about just reveritng the patch but then > > also add a kern_addr_valid()? > > > > I'm also confused about people talking about just reverting the patch, as > > 4c91c07c93bb drops the bounce buffer altogether... presumably they mean > > reverting both? > > > > Clearly this is an arm64 thing (obviously), I have some arm64 hardware let me > > see if I can repro... > > I see the issue on x86 Ummmm what? I can't! What repro are you seeing on x86, exactly? > > > > > Baoquan, Jiri - are you reverting more than just the one commit? And does doing > > this go from not working -> working? Or from not working (worst case oops) -> > > error? > > yes, I used to revert all 4 patches > > I did quick check and had to revert 2 more patches to get clean revert > > 38b138abc355 Revert "fs/proc/kcore: avoid bounce buffer for ktext data" > e2c3b418d365 Revert "fs/proc/kcore: convert read_kcore() to read_kcore_iter()" > d8bc432cb314 Revert "iov_iter: add copy_page_to_iter_nofault()" > bf2c6799f68c Revert "iov_iter: Kill ITER_PIPE" > ccf4b2c5c5ce Revert "mm: vmalloc: convert vread() to vread_iter()" > de400d383a7e Revert "mm/vmalloc: replace the ternary conditional operator with min()" > > jirka That's quite a few more reverts and obviously not an acceptable solution here. Looking at https://lore.kernel.org/all/CAA5enKaUYehLZGL3abv4rsS7caoUG-pN9wF3R+qek-DGNZufbA@mail.gmail.com a parallel thread on this, it looks like the issue is that we are no longer using a no-fault kernel copy in KCORE_TEXT path and arm64 doesn't map everything in the text range. Solution would be to reinstate the bounce buffer in this case (ugh). Longer term solution I think would be to create some iterator helper that does no fault copies from the kernel. I will try to come up with a semi-revert that keeps the iterator stuff but keeps a hideous bounce buffer for the KCORE_TEXT bit with a comment explaining why...