Message ID | 20250114-virtual_address_range-tests-v4-0-6fd7269934a5@linutronix.de (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 F284DC02183 for <linux-mm@archiver.kernel.org>; Tue, 14 Jan 2025 16:07:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D20896B0089; Tue, 14 Jan 2025 11:07:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CCCF36B0088; Tue, 14 Jan 2025 11:07:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A59AA280002; Tue, 14 Jan 2025 11:07:13 -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 7DCCA6B0088 for <linux-mm@kvack.org>; Tue, 14 Jan 2025 11:07:13 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 13800C0B93 for <linux-mm@kvack.org>; Tue, 14 Jan 2025 16:07:13 +0000 (UTC) X-FDA: 83006536746.17.AE73E3E Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf29.hostedemail.com (Postfix) with ESMTP id 10422120007 for <linux-mm@kvack.org>; Tue, 14 Jan 2025 16:07:10 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b="z/tZ0aXh"; dkim=pass header.d=linutronix.de header.s=2020e header.b=ztssdGuy; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf29.hostedemail.com: domain of t-8ch@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=t-8ch@linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736870831; 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:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=MZHG5cplY7kOQjkYg0UFJ5wapfsIw4i4b0LWQfZHuc0=; b=ztO2XzzgpcuE66kBvt5+tK9X1h4KshTGmxE20ZSiyqydNV2iNHAjVvZfBisD/P29ANoFfe INa6+JEO83OFuGlB+Mjd5kIaQP5yCV80PyHtanp+z5W5+N8eK3zd7/2jM5PFUnpAN52PYF gMziI3FoiAf4A42r5IIbc1ujZ4/6uEw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736870831; a=rsa-sha256; cv=none; b=xBZP7IaNDD0ZskQVJ6qH/g5g44VtaFc96ahQ9+vxS3HfWIBzwQBkHfgiKEPzgf6vVGJnXp gRuhN7djChYLMCVrxhglhUWc0Rx1nF6V8om3DbvhdVhswcWw8FeYiLvL79hV5AC0o4Zfjy bU5RPcMlUcxCMsigW6QPDt7PBiP7dD0= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b="z/tZ0aXh"; dkim=pass header.d=linutronix.de header.s=2020e header.b=ztssdGuy; dmarc=pass (policy=none) header.from=linutronix.de; spf=pass (imf29.hostedemail.com: domain of t-8ch@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=t-8ch@linutronix.de From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <thomas.weissschuh@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736870828; h=from:from: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; bh=MZHG5cplY7kOQjkYg0UFJ5wapfsIw4i4b0LWQfZHuc0=; b=z/tZ0aXh81J5YpaGd5ITORbmkhACMbvm9HjmELE72REQgA9EuMIPrhab4GCllreSpB4v1b gkCURpauuSfcRlmdhyL0THDvMnip9FQ7hdE+ZCk7m9gGo7LQF/z4ZJCZZvlS+0D13yfEkb B/mdHoSPx4KTyXh9oLbiFNk+SNycm7No3IEN2B83ysq3zBBVylaLDlyHPAhNUXxhjRODnZ 6AVSYW1WKyro9YFgApTYR97wWdvShAk5fDRCwg/dVuIT2v/dm1Stko3Vj6/nEcdU09TQ+l 6wWh6ggTrwvZ6Akm21udLjnEzhyk+HCTOkCqHZRdzkorC2LK5cDbta3R09fQTA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736870828; h=from:from: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; bh=MZHG5cplY7kOQjkYg0UFJ5wapfsIw4i4b0LWQfZHuc0=; b=ztssdGuyzyl7d4DYVeWXjNihOQFdu2SjfKrasg1ASUPcTFghF9jWeyEFxKRD0W1HvMlt04 TPAJyyDUib5Bc3Cw== Subject: [PATCH v4 0/4] selftests/mm: virtual_address_range: Reduce memory usage and avoid VM_IO access Date: Tue, 14 Jan 2025 17:06:44 +0100 Message-Id: <20250114-virtual_address_range-tests-v4-0-6fd7269934a5@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAJSLhmcC/43OSwqDMBCA4atI1k2JSXy0q96jFIlmUgdESxKDR bx7oyspRbr8h+GbmYkDi+DINZmJhYAOhz6GPCWkaVX/BIo6NuGMZyxlBQ1o/ai6SmltwbnKbks enHf0kpVSFHlu1KUgUXhZMDht+v0Ru0XnB/vejoV0nf7nhpQyKkohFTe1LAzcOuxHb4cep7MGs tqB77yUHXs8ejznitdGNEKzX57Ye+LYE9EzUpWQ1/E70N/esiwf9N1sCGoBAAA= X-Change-ID: 20250107-virtual_address_range-tests-95843766fa97 To: Andrew Morton <akpm@linux-foundation.org>, Shuah Khan <shuah@kernel.org>, Dev Jain <dev.jain@arm.com>, Thomas Gleixner <tglx@linutronix.de>, David Hildenbrand <david@redhat.com>, Anshuman Khandual <khandual@linux.vnet.ibm.com> Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <thomas.weissschuh@linutronix.de>, kernel test robot <oliver.sang@intel.com> X-Developer-Signature: v=1; a=ed25519-sha256; t=1736870827; l=2074; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=jY1f7K/6+plS20TimE67aTBJCu8JXlgGF6WROI3pbDA=; b=5vgoHzJPyXAxCnx8bc1uNJMRsMHv/BNIZaNt9xqWXYnLMcD57iCcg37uUu6Nb+pKkTYM44AeG 93quzhF3k6MCS4B6B4JoWonxhqon0Nnwg477bWYyDzhSIgAdptnxqUc X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= X-Stat-Signature: p93jeomfei3w1tpy8fhp5uccs896xook X-Rspamd-Queue-Id: 10422120007 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736870830-441261 X-HE-Meta: U2FsdGVkX19n3sKqDruqdsYjn820dmPtP2Aeq8cFMuNDiu0wQ5UZub63jaFHUfLlLK7UQGw/bmFUifks67P70abIl7ogmsZe2lUg9Fp+QwXSE99tH7518bUTZCgEAEqbIt2qhsNxZrNVjPwr0M+/hE+22GaZfyvLeZAiVAX6tRPfFdav3Wuc3IYjX5RmhImAgnU2xNaDXej2IisCxxUzQWqDZ+jHkWZWbe3wqFLzLMrzto9yEXlfT6ryDyFBnNc9ISKmzTAlUTHsFTvDVGiE32n1pU49R8dpWuhoDbwgNgXufxyaRP4MwKstmDzDakJm4GpuuYEmsDtORkNCN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xENL2qDFBsdpyBOE+MmPNt2AeyVcXuLeYRxXWA+8XhCztCmnpbzDTFsPFH075ErQ+Csg5Vu 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
selftests/mm: virtual_address_range: Reduce memory usage and avoid VM_IO access
|
expand
|
On 14.01.25 17:06, Thomas Weißschuh wrote: > The selftest started failing since commit e93d2521b27f > ("x86/vdso: Split virtual clock pages into dedicated mapping") > was merged. While debugging I stumbled upon some memory usage > optimizations. > > With these test now runs on a VM with only 60MiB of memory. 60 MiB ? Crazy :)
The selftest started failing since commit e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping") was merged. While debugging I stumbled upon some memory usage optimizations. With these test now runs on a VM with only 60MiB of memory. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> --- Changes in v4: - Pick up review tags - Correct Fixes: of patch 1 - Drop git rebase commit message artifacts - Replace strtok_r() with strspn() and strcspn() - Avoid uninitialized read on error in __get_smap_entry() - Link to v3: https://lore.kernel.org/r/20250113-virtual_address_range-tests-v3-0-f4a8e6b7feed@linutronix.de Changes in v3: - Pick up review tags - Fix naming around PR_SET_VMA_ANON_NAME helper functions - Skip selftest if PR_SET_VMA_ANON_NAME is not supported - Check for VM_IO instead of [vvar name prefix - Link to v2: https://lore.kernel.org/r/20250110-virtual_address_range-tests-v2-0-262a2bf3c3d0@linutronix.de Changes in v2: - Drop /dev/null usage - Avoid overcommit restrictions by dropping PROT_WRITE - Avoid high memory usage due to PTEs - Link to v1: https://lore.kernel.org/r/20250107-virtual_address_range-tests-v1-0-3834a2fb47fe@linutronix.de --- Thomas Weißschuh (4): selftests/mm: virtual_address_range: mmap() without PROT_WRITE selftests/mm: virtual_address_range: Unmap chunks after validation selftests/mm: vm_util: Split up /proc/self/smaps parsing selftests/mm: virtual_address_range: Avoid reading from VM_IO mappings tools/testing/selftests/mm/config | 1 + tools/testing/selftests/mm/virtual_address_range.c | 41 ++++++++++++-- tools/testing/selftests/mm/vm_util.c | 66 +++++++++++++++++----- tools/testing/selftests/mm/vm_util.h | 1 + 4 files changed, 92 insertions(+), 17 deletions(-) --- base-commit: 3043cb9a517b707c12a3f5879f4970c97bfeb3fb change-id: 20250107-virtual_address_range-tests-95843766fa97 Best regards,