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 26442C32792 for ; Tue, 23 Aug 2022 09:55:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B57818D0002; Tue, 23 Aug 2022 05:55:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B07478D0001; Tue, 23 Aug 2022 05:55:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CF508D0002; Tue, 23 Aug 2022 05:55:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 89C348D0001 for ; Tue, 23 Aug 2022 05:55:06 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 62B5C141525 for ; Tue, 23 Aug 2022 09:55:06 +0000 (UTC) X-FDA: 79830399012.23.E915A8D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf04.hostedemail.com (Postfix) with ESMTP id E011D40047 for ; Tue, 23 Aug 2022 09:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661248505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eNgzriyywXL9TuuKIudqOgLv5q07dltNhohdSXbABsY=; b=Or8nBOgApxqHJ1akLS+TXERntga20yjtsfjo+MFokOZwPEz8OUH8E4mUfbmx/A5raUAf2F zM/RYNQphY2j5uuVJE8m/melHM9AigxG1GFdMkFDG9wht6LvJwzRv9gccGKmq60GxXxeRa Q4KWsHdJJ37Mv1+AuVMfIUZsp059I5U= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-668-ghR56uiXP8C5xgVI_KtEMQ-1; Tue, 23 Aug 2022 05:55:01 -0400 X-MC-Unique: ghR56uiXP8C5xgVI_KtEMQ-1 Received: by mail-wm1-f69.google.com with SMTP id i7-20020a1c3b07000000b003a534ec2570so8510707wma.7 for ; Tue, 23 Aug 2022 02:55:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=eNgzriyywXL9TuuKIudqOgLv5q07dltNhohdSXbABsY=; b=Dz6vvadwZNjHvzUYd3U1Tb+/WHEYCl+MrlcKY7l2sRl75wnpBM3XpUmFhloXn1nBca yLLUK5XwoX9AMpsHH6/40gl0RdUcyJm2py0DGTO0goLS7Q276+3xHuDisOjVw1f9zLey xOqEMu6KmCZL3h4cGMhn7QMqgBe6hWjhSgFlbm+K1A0fxZD8NazeD1mRFOjnl0yhjRkO jGTHdSnfLEkKn0A/XcOm3BQ90XxE3bvrWWZBdR9NHnJhGZgZS7fdtW9S7hW4UUAaOuOS F5gEItYp3nwYAA/FTBdJ40ONxPRsOkJMhHdAyViW+yNFH1rHHDMQN1Hv/py2IaC6Nesn s1Zw== X-Gm-Message-State: ACgBeo2wxu0RBGQx+fJLkGgauY3uYF62iSvgtg4L5jgZgE+iJ6aHDTFc yRF7AQvKWMQjSG96oYrkTXWwdoZ5pvWYXnCo7eb/RhMiF7LDpscZOEehFVTJNszIkHAq1US5KcN irxdvpWWFZag= X-Received: by 2002:a05:600c:3ac6:b0:3a5:c03f:510d with SMTP id d6-20020a05600c3ac600b003a5c03f510dmr1627262wms.120.1661248500589; Tue, 23 Aug 2022 02:55:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR65Jq1hO7F3LQ7a1IOP4qhQdMKQbbjgZXrDqYYser19vNBXf0fVzg1beAiFRcgPcWCQF4arLw== X-Received: by 2002:a05:600c:3ac6:b0:3a5:c03f:510d with SMTP id d6-20020a05600c3ac600b003a5c03f510dmr1627249wms.120.1661248500265; Tue, 23 Aug 2022 02:55:00 -0700 (PDT) Received: from ?IPV6:2003:cb:c70b:1600:c48b:1fab:a330:5182? (p200300cbc70b1600c48b1faba3305182.dip0.t-ipconnect.de. [2003:cb:c70b:1600:c48b:1fab:a330:5182]) by smtp.gmail.com with ESMTPSA id n17-20020a5d4851000000b0021eff2ecb31sm13784512wrs.95.2022.08.23.02.54.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Aug 2022 02:54:59 -0700 (PDT) Message-ID: Date: Tue, 23 Aug 2022 11:54:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 8/8] memblock tests: add tests for memblock_trim_memory To: Rebecca Mckeever , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <4157021eecdd3abb503d4b1d1449844baac2d7b9.1660897732.git.remckee0@gmail.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <4157021eecdd3abb503d4b1d1449844baac2d7b9.1660897732.git.remckee0@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661248506; a=rsa-sha256; cv=none; b=xj+d27r/VY4AMDKlODtT0SADzP/lcr3mwF6RLL12qpL07thZtp9rhcBKvKqSAbggixQ5mV 1XgcwOWQywNHcuCQh42qHAzePLwlyIHTnrfGAlOCWOF4oTaf5XYtO98Q7w/k54FQeoUjn6 J/kGBvj8ZiTBn0wmz/87aOrkojCoJsc= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Or8nBOgA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661248506; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=eNgzriyywXL9TuuKIudqOgLv5q07dltNhohdSXbABsY=; b=TsB4eh1dqOKSc5OVatvfosoIWLCgJjLKmG1u3UKwajGhOJgMPVY/dSMn8GW9To82bh5X30 hr9xl2vUD60cceIl0ESw0ELeZJzCiKzZ9mGMAsnVhnsebmC2w6OPuVLHCtsqToM6IswJED v7FeMTXXbtpJCbdBWuxpqCSP4FLO6cc= X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Or8nBOgA; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E011D40047 X-Stat-Signature: u614jxs5n84awiqgfmjq1ynsod9yg3sq X-HE-Tag: 1661248505-485110 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: On 19.08.22 10:34, Rebecca Mckeever wrote: > Add tests for memblock_trim_memory() for the following scenarios: > - all regions aligned > - one region unalign that is smaller than the alignment s/region unalign/unaligned region/ > - one region unaligned at the base > - one region unaligned at the end "unaligned region" ? [...] > > +/* > + * A test that tries to trim memory when both ends of the memory region are > + * aligned. Expect that the memory will not be trimmed. Expect the counter to > + * not be updated. > + */ > +static int memblock_trim_memory_aligned_check(void) > +{ > + struct memblock_region *rgn; > + phys_addr_t alignment = SMP_CACHE_BYTES; Could make that "const" -- same applies to other functions. > + > + rgn = &memblock.memory.regions[0]; > + > + struct region r = { > + .base = alignment, > + .size = alignment * 4 > + }; > + [[[.] > +static int memblock_trim_memory_checks(void) > +{ > + prefix_reset(); > + prefix_push(FUNC_TRIM); > + test_print("Running %s tests...\n", FUNC_TRIM); Just a note that this could have been test_print("Running " FUNC_TRIM " tests...\n"); But it's good to keep this consistent for all tests. Nice test cases! -- Thanks, David / dhildenb