From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B571FC00528 for ; Mon, 31 Jul 2023 21:12:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 251E02800A9; Mon, 31 Jul 2023 17:12:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 201B928007A; Mon, 31 Jul 2023 17:12:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CBCD2800A9; Mon, 31 Jul 2023 17:12:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EEBAF28007A for ; Mon, 31 Jul 2023 17:12:13 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B45F01601F4 for ; Mon, 31 Jul 2023 21:12:13 +0000 (UTC) X-FDA: 81073154946.29.7939B40 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by imf16.hostedemail.com (Postfix) with ESMTP id BE634180019 for ; Mon, 31 Jul 2023 21:12:11 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="n6g/Ss/s"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=lstoakes@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690837931; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Cvkb1F7VeYbirXxnx/x7mD/WcXLmaxSiQihg0hXEQQg=; b=qLWgr1hLzvc0Whvdr33vPqrZePkOCW0XeuiV7GuVbR9xQ3qRY6ttSvAr3gwY/S1Mj/8be8 7OjBuwOEmyHaMempOIOqm64DGdcK9BX6lWJV7Y2N3T6+ygFHWHldCWvLonGyro804i7Egd tfVcT7C5xaJ/JVbr5Sy7ey7ObstMDwM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="n6g/Ss/s"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=lstoakes@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690837931; a=rsa-sha256; cv=none; b=rOzuRcBYJ19y0yShDJ/ss/dvtK0qJSuqsNT470GEu9NLDlTnHhZZPQO59XylFfDRMKRpNM WFS5vl/kYx8ZoFn6Bb7oG04Qowo2lG5sRg49Bq2vGQTcO1g3mob7QxkmisjPes34T3f9W3 ONISvYpoVFlQpahAC8zWl+DTkBGTygY= Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3fbc5d5746cso53695485e9.2 for ; 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=Batqft/+oZHuo5RYR8vCuIq+IuOtAVMXlggB0kUd25+DWL7Y+y2T7JYCW573aPcSnt qF33MWc4zN6wL/hSTIDXESxiWjBRxN6CjaApscgf/Jf58rbFICjPJ8Mz6rK/5Q5t1Dws I4mR0aFQdMC0GIfwZ1ouUo/+t3POrsmYoan0G/miwq2pu4qe8ze5ZDdFCl+2awpp0PZ/ +m66InlXGDWbA9sP1uTQ5sHO91SxiMZql1OW4ggfphX/CpnzDjgaZ4GK70aG6Gwem+QR 2xwB8WawFz9u7JZdzyvmw9v7hBPQ05Pix0SltsaJavIN8wB0p2y9belndZPYoTht24R+ 773w== X-Gm-Message-State: ABy/qLbdj+swjxYOQSxNK4yukBpSbOwUpUdQfv6Z/V/+cdI15VUKX5gA ahT1KTS+5pY2kyU7rO7rWoM= X-Google-Smtp-Source: APBJJlFMnVUrPHPp6WA73ZZia48T89g5i5rzrlvGXpGuYDrSD6cjZj2jDc2G7hW1ghXlOExCwxVujA== 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-Rspamd-Queue-Id: BE634180019 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 77x4eha5da5h1ntmzrbxzw5yciuopxge X-HE-Tag: 1690837931-795824 X-HE-Meta: U2FsdGVkX1/j1pxf5SvsOKV6UiG9GeNLEdYEcHFkAxDeCa/mSvh6fxNMyPTpzfZPR8tptX3mWzC9+evXs4gmpSO/0XQChIYViYmuo63IxuZcb+jwU8iUVOk1qfTwJ1qt0iA5J/zb5JVw0AltH1mvvQ0ShYmNA4VJB87UwOevOqesCpmhxcYK+CKP5RM7oaznfsohhHlLZAhnyyuoCodnBankYYvVe6Gtx0xMQdMz4+/nehnFL9i5fJkOD5ISHgt78wFst1nx5sVbEDCq3lHmWSkQvfodlIVryvnrAEkgujPTbdIVMEj+PPNN4uVEkRgaGKU0eNjY4wnY03s8J06LL23kK5jccwuhYwzi5IXdfi+LROTk0qZowFiHdhCXbUd4xXMzzdBHJeQvnHpr7FV8Vk8p+n8T8MZmt7jtmrP8V7jPeYj8YQ3FtRWX9Nxku1WWtRV5Qoi+mzxHXk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ack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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...