From patchwork Mon Dec 5 19:37:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13065040 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 5C531C4332F for ; Mon, 5 Dec 2022 19:37:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0540B8E0007; Mon, 5 Dec 2022 14:37:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 004418E0005; Mon, 5 Dec 2022 14:37:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0ED58E0007; Mon, 5 Dec 2022 14:37:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D20EA8E0005 for ; Mon, 5 Dec 2022 14:37:47 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9C6721C58AC for ; Mon, 5 Dec 2022 19:37:47 +0000 (UTC) X-FDA: 80209262574.28.BEFC114 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf06.hostedemail.com (Postfix) with ESMTP id 3C3E4180010 for ; Mon, 5 Dec 2022 19:37:47 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PJuc7+u1; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.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=1670269067; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TJPhHvXoEWGArXjq8wabcPZKm6Vu3pXc0PH2frV06/s=; b=HHsH7ofTV8PM937K39om69l8VglpwgklZ2a/2pSUevmpaCOZqR0iqCP8Qi1FEoxsHFduyX ELLSoCQruWPzp3owNz5rO8xUkwiDv6Sy+bN2oMkEOLDC8Ux37N/8Z6BCf185gWf3CQolMw TbtNnk68txB4ToxI/S0lpBpZRV+HxA0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PJuc7+u1; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf06.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670269067; a=rsa-sha256; cv=none; b=uurExXXB7HFWfJCs6MFv4kM1eQptUvpztYVHgWsjpj8sZKIg+q0pUCd8xkYmza2EUkYOs4 sPim2p45OrjgfcD1XTBdzAq+xjyGDbAbYSlm+1FMUSUOohS7DkLEB2i1mlnttv+NXH3CsS AlE/gPIUnC/FU+kRDHn45n2TGEdeB10= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670269066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TJPhHvXoEWGArXjq8wabcPZKm6Vu3pXc0PH2frV06/s=; b=PJuc7+u1FyGHggy0rRtLc2f1+OA5jyya8nol9QoK3g/It1s8uXavx4yhlGXbcgmAUYqsAF iyqBYCVyrLeBOMpD37yNS/NaXXd5ldjKPwe+5np/v/6H4EYkF/XQU+A/ecRITCXkMCje7g tnxl4k4/j1oAO/6ea3WsDkPUdb4JAGw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-300-_50uqGV7N52EuauiOE6EBQ-1; Mon, 05 Dec 2022 14:37:30 -0500 X-MC-Unique: _50uqGV7N52EuauiOE6EBQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A538486F12A; Mon, 5 Dec 2022 19:37:29 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.193.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 308142028E98; Mon, 5 Dec 2022 19:37:28 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, David Hildenbrand , Andrew Morton , Shuah Khan , Yang Li Subject: [PATCH mm-unstable v1 4/4] selftests/vm: ksm_functional_tests: fixes for 32bit Date: Mon, 5 Dec 2022 20:37:16 +0100 Message-Id: <20221205193716.276024-5-david@redhat.com> In-Reply-To: <20221205193716.276024-1-david@redhat.com> References: <20221205193716.276024-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3C3E4180010 X-Stat-Signature: 89ti8kaftddd56wh6cd8bxozrfos4dsa X-Spamd-Result: default: False [-2.40 / 9.00]; BAYES_HAM(-6.00)[99.99%]; R_MISSING_CHARSET(2.50)[]; MID_CONTAINS_FROM(1.00)[]; SUBJECT_HAS_UNDERSCORES(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[redhat.com,none]; R_DKIM_ALLOW(-0.20)[redhat.com:s=mimecast20190719]; R_SPF_ALLOW(-0.20)[+ip4:170.10.133.0/24]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; RCPT_COUNT_SEVEN(0.00)[7]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[redhat.com:+]; RCVD_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_SOME(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; ARC_NA(0.00)[] X-HE-Tag: 1670269066-583019 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: The test currently fails on 32bit. Fixing the "-1ull" vs. "-1ul" seems to make the test pass and the compiler happy. Note: This test is not in mm-stable yet. This fix should be squashed into "selftests/vm: add KSM unmerge tests". Signed-off-by: David Hildenbrand --- tools/testing/selftests/vm/ksm_functional_tests.c | 4 ++-- tools/testing/selftests/vm/vm_util.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vm/ksm_functional_tests.c b/tools/testing/selftests/vm/ksm_functional_tests.c index 96644be68962..b11b7e5115dc 100644 --- a/tools/testing/selftests/vm/ksm_functional_tests.c +++ b/tools/testing/selftests/vm/ksm_functional_tests.c @@ -42,13 +42,13 @@ static bool range_maps_duplicates(char *addr, unsigned long size) for (offs_a = 0; offs_a < size; offs_a += pagesize) { pfn_a = pagemap_get_pfn(pagemap_fd, addr + offs_a); /* Page not present or PFN not exposed by the kernel. */ - if (pfn_a == -1ull || !pfn_a) + if (pfn_a == -1ul || !pfn_a) continue; for (offs_b = offs_a + pagesize; offs_b < size; offs_b += pagesize) { pfn_b = pagemap_get_pfn(pagemap_fd, addr + offs_b); - if (pfn_b == -1ull || !pfn_b) + if (pfn_b == -1ul || !pfn_b) continue; if (pfn_a == pfn_b) return true; diff --git a/tools/testing/selftests/vm/vm_util.c b/tools/testing/selftests/vm/vm_util.c index 710571902743..40e795624ff3 100644 --- a/tools/testing/selftests/vm/vm_util.c +++ b/tools/testing/selftests/vm/vm_util.c @@ -50,7 +50,7 @@ unsigned long pagemap_get_pfn(int fd, char *start) /* If present (63th bit), PFN is at bit 0 -- 54. */ if (entry & 0x8000000000000000ull) return entry & 0x007fffffffffffffull; - return -1ull; + return -1ul; } void clear_softdirty(void)