From patchwork Tue Jul 16 18:33:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13734746 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 53EFDC3DA59 for ; Tue, 16 Jul 2024 18:33:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B40BD6B0095; Tue, 16 Jul 2024 14:33:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF0B66B0098; Tue, 16 Jul 2024 14:33:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DFD36B009A; Tue, 16 Jul 2024 14:33:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 836516B0095 for ; Tue, 16 Jul 2024 14:33:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id CFE1D1A0772 for ; Tue, 16 Jul 2024 18:33:41 +0000 (UTC) X-FDA: 82346464242.19.A74ABBD Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf02.hostedemail.com (Postfix) with ESMTP id 4ADFF8001F for ; Tue, 16 Jul 2024 18:33:40 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ba5Tj+mx; spf=pass (imf02.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721154781; 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:references:dkim-signature; bh=rUToMK4REqcNaq2hAiTrKu4+jgi2B1Rbn+y1G3bdwrU=; b=62JFMoUE9OcpCZbHvFFJ+HPJlfk1u/FPoee8eFAo40gncQgsTBUlRhiqKVWvweq95BRh95 kN52uNiM10xe/gJm22SjsrC6UWIqV7afQLGoRYNJiQtiR89vO8q5eYrlnUX8ignyaVY/V2 YTdv1uzsPW9pO1UaRv02M8FL26J/yjo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721154781; a=rsa-sha256; cv=none; b=Aud0lwHKzU5JHxlUP7TsUAWH+7ZgounOhhHLZA0MxFPUYD71IZNCz/TPaF55ZDfsCAZHGf 7kSqarPSmcY3YZdE9OhKMGgmR6QC//Yyjhn9W6eTcrPngS3jjlS+8bVfbzSUmehEDNhNlU fQLbtmkz7/YClDtlr1EHlJGOvNug7/s= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ba5Tj+mx; spf=pass (imf02.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5A70C612DC; Tue, 16 Jul 2024 18:33:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F0D9C4AF0E; Tue, 16 Jul 2024 18:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721154819; bh=RoTz8SCDctxTyPa/A3kJf11i3VVBdS3TP8fU1fccXPk=; h=From:To:Cc:Subject:Date:From; b=ba5Tj+mxToRnRvQFkDDUXX1LI3YQCVsfunTbHPZdgbMp3Fosf9I/uRFn+aTUNw3gr ncHffD5kX8NBDV4VHTTxnO1UadEYU4YWVoPz83NyFHLD2zOTiBpR9fEUduZVV+TeWg kvxFWaH+jsBng/DIHdwBWjcEpbo3XgJsgg8gmhPL7SXCPbveCDZropmyKJPvtQwRD5 iIdQizTJevrzaYVjcoZJP9kM1hSbsU4IvY+sahjlblKkBK0EaTQoFhpMc3tsQt7TG0 octmW0uD0GEEgMFNOTUxN+VisZb7SA2AKtadC4g4CMNKP8kdDwpYcDLEJCCm+kSYtd sZqZ3Wk0fjKQQ== From: SeongJae Park To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: SeongJae Park , Andrew Morton , Ingo Molnar , Luc Van Oostenryck , Steven Rostedt , damon@lists.linux.dev, linux-mm@kvack.org, linux-sparse@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5.15.y 0/8] Backport patches for DAMON merge regions fix Date: Tue, 16 Jul 2024 11:33:25 -0700 Message-Id: <20240716183333.138498-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4ADFF8001F X-Stat-Signature: zh68kda1z1m95cu6hf3z67i1yjiy4a7c X-HE-Tag: 1721154820-598618 X-HE-Meta: U2FsdGVkX18ygCjvk+1qhQGCd873t+UZpJFHFXe4e0MgdwosbMaW/zeGzhaSwExURhuaVbaeyDpVNq2WW8AWP+uTFp3v0k+ob89d8jLddNgUkeichX4mUlnCytD1fTRehOYS2fZylINRsY8kFqG07qJH5usQYCPG19va/+Oo7/7aDQb9X7evWyYc6WItpH13EQDr80qDMNvVIenBh/+DRirAgFGjzGcIlkZbe+HgOThMIBECvpkyOgBJzf/EuHSx9tSHh7PgOdrkkwEPVIDDSkEttvecWtsUPTE+NDRPPFkW+z/b1uWaggPlnLkZI6eyjgwBoMsDVKQCYfa5/M2HaOmCK37xPC1Ohikjs3sZCKNp9iXdAyokTrGWnX9rnNTQ2dS1NQVCwYbRjpe13hvf/QzuEQusZax0VlfReJIf+oN1g4aaY41WU3V5oPfYnIHCJIpofEPmfcdUinn72ZzqIKwI5RgtKqHqHCCeuuF3tnWtaJxuPcMiENBOCrxmxWbKjlBpp8C0zgYyCTTDqWeGGMaHXm3b8HGY9WoIlb2p/DA6CT2v6wprrHcpy1DnmK0UqML+oZcNhPbVdX/vmjFR7/Rhvg5Z14qkoHnS6ZycAmNUCybD192RVtIuclGyFtsTD+Ppq6H42fhP7yQqGuwOMeKgzCyodqK+HNW2QByyfCcUsQTRSesPxzvRnvH3juo64jR1glUNBXJwlA/hbVVWhdu7CSEH8SV5egzywHhcDdQzYbrZCdwUCivIldXBUu5QkcTMv3etOMpGG5HS3tkygVlsbLQDiKO5Eg2trh+imBRoPU+ZCi9+NI6rC7yBZxCMtyw1lBooy2FV650ntW4MzH3zS2Fdo7xTeXzx1KTssXAztEGOHOIoJj3cH8Y7kIjCksJlZg5/QRMmqU59axfERGLxUw8egJXH1jdtcjeZdAvYsQAt7t/ZJqEcEDXhu+2UyOFS7EjM5txHgSLJ5iU EDNJCwix 3mpnIAOwNzFw8/61oVR7rO7gdu2meA8S8FfgnLIjqO2wHieZP8Im384Ggt408XnfLMunmEc3hbhTlz+sWaJL65f0SnXwu7co2sUm6UxlPKYkF8p0j9l+P8vyblZrQjHLuQqw51XmC4nYlO0iZTYK71rSSfL8ZviilhRYvJnSlWTYyLD8UAUI3uSh8SGhpkvydSh6j+7xkak8tcODk0x71l3nAM8PTEl0OsewCEye4ea48bv3KPJ/WbMXQxb65675kIakdpvy9m27DWn+CN9arBeXv8GTKjMgXbxPIuyRXrG0gSRHOJbKwYZHf+tg5zQ1k+RnTdBDLid7lG55lPFUfirIVGg== 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: Commit 310d6c15e910 ("mm/damon/core: merge regions aggressively when max_nr_regions") causes a build warning and a build failure [1] on 5.15.y. Those are due to 1) unnecessarily strict type check from max(), and 2) use of not-yet-introduced damon_ctx->attrs field, respectively. Fix the warning by backporting a minmax.h upstream commit that made the type check less strict for unnecessary case, and upstream commits that it depends on. Note that all patches except the fourth one ("minmax: fix header inclusions") are clean cherry-picks of upstream commit. For the fourth one, minor conflict resolving was needed. Also, the last patch, which is the backport of the DAMON fix, was cleanly cherry-picked, but added manual fix for the build failure. [1] https://lore.kernel.org/2024071532-pebble-jailhouse-48b2@gregkh Andy Shevchenko (1): minmax: fix header inclusions Bart Van Assche (1): tracing: Define the is_signed_type() macro once David Laight (3): minmax: allow min()/max()/clamp() if the arguments have the same signedness. minmax: allow comparisons of 'int' against 'unsigned char/short' minmax: relax check to allow comparison between unsigned arguments and signed constants Jason A. Donenfeld (2): minmax: sanity check constant bounds when clamping minmax: clamp more efficiently by avoiding extra comparison SeongJae Park (1): mm/damon/core: merge regions aggressively when max_nr_regions is unmet include/linux/compiler.h | 6 +++ include/linux/minmax.h | 89 ++++++++++++++++++++++++++---------- include/linux/overflow.h | 1 - include/linux/trace_events.h | 2 - mm/damon/core.c | 23 ++++++++-- 5 files changed, 90 insertions(+), 31 deletions(-) base-commit: 4d1b7f1bf3858ed48a98c004bda5fdff2cdf13c8