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 8A10FC48291 for ; Fri, 2 Feb 2024 16:50:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE95D6B0080; Fri, 2 Feb 2024 11:50:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E98D56B0082; Fri, 2 Feb 2024 11:50:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6C8F6B0083; Fri, 2 Feb 2024 11:50:03 -0500 (EST) 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 C689F6B0080 for ; Fri, 2 Feb 2024 11:50:03 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 98BC6160768 for ; Fri, 2 Feb 2024 16:50:03 +0000 (UTC) X-FDA: 81747451086.09.523401D Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) by imf03.hostedemail.com (Postfix) with ESMTP id BACE02000E for ; Fri, 2 Feb 2024 16:50:00 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=DVkgZZfi; spf=none (imf03.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 62.89.141.173) smtp.mailfrom=viro@ftp.linux.org.uk; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706892601; h=from:from:sender: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=s9JPuMGns8g3lIGXW/Eg6QZhxZ7uPg73+hdVmq5mOgM=; b=OiS6RSMNayJYNwPahwXu8TSyu0qW82H9sm0IRjI8qPPeKnpQvFjys2c3qD1VH/DvMLZOR2 Y7zGvUXunaHKsHPs4KFzFY8On0QDNmtYw5zntjukYxqrr3x792U6kDkl/rht6HzH/6dXSI k1kAwgAPI0VkBzdZaa+k4y6NMymSNRE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706892601; a=rsa-sha256; cv=none; b=waPMhuvKjopMq52agNQN97xEMuaecZZf93fGl2ZqVSuY5k36xl8vy02H8QdckT48njcqYx lnzB8Ev4YSVYy2XHoOEjAPvHbH2OqIgpl3wBAeETddXnxSN74ZhpDz4dAOENplHfAgRozc XxBCjv6QGZ6wJ5+mo90ttRtpKjNFzsk= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=DVkgZZfi; spf=none (imf03.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 62.89.141.173) smtp.mailfrom=viro@ftp.linux.org.uk; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description; bh=s9JPuMGns8g3lIGXW/Eg6QZhxZ7uPg73+hdVmq5mOgM=; b=DVkgZZfi2r2C6r6Wp9n1fbDZkc DDthIagMB72CZNj3c6Nd+qnHEjDJhCtk+e7YNlPIhSqbXDIlapav868Tf9f0/nGKw/U7L571XMIo/ 5Eae+fjojVYAmCBw2LZrYx1fVhXpXagV6YrjFm31MBr9ITLM++fJ32peBWHWA/YkQKCYl0OHDrwfr Zo6hElXlTyGl43i2hChpfarFNlP0vWwH0XO6sSiqypqKfPoqU8FWG0fOULIEZ6sfvBQCwB6nr3glw R6Cs4T7oJSHCS1ujs+1XRpag4wm5e76zFGg+MKHKGHA1W+YALv8TKXFVZ+RVTsApAkdeSQt7lm75k BJ9uapJg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rVwjb-0047ud-1N; Fri, 02 Feb 2024 16:49:47 +0000 Date: Fri, 2 Feb 2024 16:49:47 +0000 From: Al Viro To: Doug Anderson Cc: Christian Brauner , Eric Biederman , Jan Kara , Kees Cook , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Oleg Nesterov , Catalin Marinas , Will Deacon , Linux ARM Subject: Re: [PATCH] regset: use vmalloc() for regset_get_alloc() Message-ID: <20240202164947.GC2087318@ZenIV> References: <20240201171159.1.Id9ad163b60d21c9e56c2d686b0cc9083a8ba7924@changeid> <20240202012249.GU2087318@ZenIV> <20240202030438.GV2087318@ZenIV> <20240202034925.GW2087318@ZenIV> <20240202040503.GX2087318@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Stat-Signature: k41z4qkjzjoe4hoa1o4dadr5w4uq39yx X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: BACE02000E X-Rspam-User: X-HE-Tag: 1706892600-51456 X-HE-Meta: U2FsdGVkX1+lEploi/zc8TVlTUIR61E8onMvxcLU+Ew7TbMTX43MHIxhrAK2qxesSPa1H+4h97DzwQo2Iw10EOSCYo+RIgRwPCErb25h8Zcz3P9DuJdNnN5NtznszkqAUgaHobgwnsfiaHjNjfl2tAq1r148rVoxA+MFZGoMzvKwY09djQyrSnKRo/Go5XF158/PdvBibfyja1I6PljtnnBRYxaWQjMBtRt5mCu0K+VUyx89miM15aMEt4Y43meeEWCJ6FZq0Xy4NEKr0TGNpcuMri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wcsn/K/RMKi4rjqJVVzQNM+zS/IEmyXvIwck/OMULfvBlojic6ZcTKLy3Zjg3IQ2BDWGPJ3k9WINAOFi5OQNzcz6FxeFXZUBlw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Feb 02, 2024 at 08:24:17AM -0800, Doug Anderson wrote: > Hi, > > On Thu, Feb 1, 2024 at 8:05 PM Al Viro wrote: > > > > On Fri, Feb 02, 2024 at 03:49:25AM +0000, Al Viro wrote: > > > On Thu, Feb 01, 2024 at 07:15:48PM -0800, Doug Anderson wrote: > > > > > > > > > > Well, the next step would be to see which regset it is - if you > > > > > see that kind of allocation, print regset->n, regset->size and > > > > > regset->core_note_type. > > > > > > > > Of course! Here are the big ones: > > > > > > > > [ 45.875574] DOUG: Allocating 279584 bytes, n=17474, size=16, > > > > core_note_type=1029 > > > > > > 0x405, NT_ARM_SVE > > > [REGSET_SVE] = { /* Scalable Vector Extension */ > > > .core_note_type = NT_ARM_SVE, > > > .n = DIV_ROUND_UP(SVE_PT_SIZE(SVE_VQ_MAX, SVE_PT_REGS_SVE), > > > SVE_VQ_BYTES), > > > .size = SVE_VQ_BYTES, > > > > > > IDGI. Wasn't SVE up to 32 * 2Kbit, i.e. 8Kbyte max? Any ARM folks around? > > > Sure, I understand that it's variable-sized and we want to allocate enough > > > for the worst case, but can we really get about 280Kb there? Context switches > > > would be really unpleasant on such boxen... > > > > FWIW, this apparently intends to be "variable, up to SVE_PT_SIZE(...) bytes"; > > no idea if SVE_PT_SIZE is the right thing to use here. > > +folks from `./scripts/get_maintainer.pl -f arch/arm64/kernel/ptrace.c` > > Trying to follow the macros to see where "n" comes from is a maze of > twisty little passages, all alike. Hopefully someone from the ARM > world can help tell if the value of 17474 for n here is correct or if > something is wonky. It might be interesting to have it print the return value of __regset_get() in those cases; if *that* is huge, we really have a problem. If it ends up small enough to fit into few pages, OTOH... SVE_VQ_MAX is defined as 255; is that really in units of 128 bits? IOW, do we really expect to support 32Kbit registers? That would drive the size into that range, all right, but it would really suck on context switches. I could be misreading it, though - the macros in there are not easy to follow and I've never dealt with SVE before, so take the above with a cartload of salt.