From patchwork Thu Apr 4 16:25:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank van der Linden X-Patchwork-Id: 13618052 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 C8D10CD1292 for ; Thu, 4 Apr 2024 16:25:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58DF56B009A; Thu, 4 Apr 2024 12:25:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53E636B009C; Thu, 4 Apr 2024 12:25:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 405FA6B009E; Thu, 4 Apr 2024 12:25:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1DE396B009A for ; Thu, 4 Apr 2024 12:25:25 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D17EC80B06 for ; Thu, 4 Apr 2024 16:25:24 +0000 (UTC) X-FDA: 81972374568.18.DCDFE68 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) by imf10.hostedemail.com (Postfix) with ESMTP id 29926C002C for ; Thu, 4 Apr 2024 16:25:22 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JmO9WkLX; spf=pass (imf10.hostedemail.com: domain of 3cdQOZgQKCIwvBt1w44w1u.s421y3AD-220Bqs0.47w@flex--fvdl.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=3cdQOZgQKCIwvBt1w44w1u.s421y3AD-220Bqs0.47w@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712247923; 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:in-reply-to: references:dkim-signature; bh=JwgqNuPbWd+ghf0eHeFjaoIaXwCHA/FmnPhXROWNzvU=; b=7Xc9UJ/uFPNz7/BvwBEwYk53nWLHk4o32QZeKbmv7pY5yo+zYl9oZtO1vobdudilCXZjTQ jCQ6dOpW8+Dc0Hqvsfpj7khOD2qwgHz3Il2e3a9r9oI4e87mCFjRj0DG5bExIW6d++oLHJ 2j1gFytt7UVvHsAJx9mjoQQUVIkdAzU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712247923; a=rsa-sha256; cv=none; b=HOmj4/qPFmxngEjOg3aNM5P5JL9lC00JR9SPxNy/jU1DTh9byrQfPfuLJwYYamWBWZ+1+w pM+SHUi9FQZAhKcDdXT+H1lqk7HahCHpqI/t6Mob/9cavuGAdXdKXnqPn7Fuy0od3YU0sT z5TqeG32HGMV6loCRvBMeYE7k/XV8+0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=JmO9WkLX; spf=pass (imf10.hostedemail.com: domain of 3cdQOZgQKCIwvBt1w44w1u.s421y3AD-220Bqs0.47w@flex--fvdl.bounces.google.com designates 209.85.210.202 as permitted sender) smtp.mailfrom=3cdQOZgQKCIwvBt1w44w1u.s421y3AD-220Bqs0.47w@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-6ecf5c622c2so290214b3a.0 for ; Thu, 04 Apr 2024 09:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712247922; x=1712852722; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=JwgqNuPbWd+ghf0eHeFjaoIaXwCHA/FmnPhXROWNzvU=; b=JmO9WkLXLsiQw2ff+bMJ5a8Wzev3RfceGpM9v6s9FzX7HDNrFMV95MAmDAblm9w19o jeGBcDXiOB2ydCSDVxO1z5oLQTjkOEkipK+KtjBxvyXo6EI3UyR+nuMu39U4OM4XU7yQ O5v7dxDpIIUMyea60bjW+YxXj2nvxngs2O+kz9rJfjXGw6OaY1Jf4cdjzjMVrRdcBbs/ CYqxJGo9mJkZ5fkHuw/TJwoCAC623GHvqsFANnSVEsREhsF+qj0Zizr8pIuS8lBujz0C EBoI3PL4YFtTB7z3HDJIWnpQbNFV5kU/Zrvp1QVJm+djQwCyZirnw5PODyheLixxOVdn ru6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712247922; x=1712852722; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=JwgqNuPbWd+ghf0eHeFjaoIaXwCHA/FmnPhXROWNzvU=; b=GC98ppmViJa1SsyEZXDWLebvlhCb02kyIyI6Zs26Xv8UpZriciNsVQCjKB5eFykd1n ryALxAiczlibFxIa9AiH5jBa7N/J3y2UGBPCJdw7GZoHukPfGutWVDllzzgS6CcC/Szb 2IDzVBMVNTsgz9Pdaz8Z0U+xKaKbwbSuTaGnZFIBRUO17oKXht8v56j27V7PQ7qdBghW LqLi1+a9Xu0h4Kn28KKeeSkG90CInYjAV0j1n16WdbYctSwtpFCvRauS2+QI9RQr7Zy3 sZGIRQ6pYjDZYoOY5xV2FXcb9iZAKRi0PxcfYpf0EOF6Ggvj7EbRSDIonBrHEmomSEiw u7HQ== X-Gm-Message-State: AOJu0Yzgo8BQTXh/Ei4mhusD4q7UDQ7NRNvsfjp8VVo/AacOFKVOnbAx wgOtIAZLJtYIraJSrrryO4L0dLK4M1lXEOqXTmNEGPpdnEXx9cmWLIPOyn94JXTsUA7jVHc9XXC s78Frq9geisLBZgqAwp+TFFv2xnxAxFoIX5Qp6I1wNVyGDrPqeNMT8nkhiV0bIJeE2PUmO7SU1Q D6LkLGShYoC23nYTJB X-Google-Smtp-Source: AGHT+IGmTy0ApIn2dhH0LzN26X146CIvoiU4QSzU9JW23Tz+Bp1C3JdAh55IZ1CT3/6jCiShvd/YXKP2 X-Received: from fvdl-cloudtop.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:46ab]) (user=fvdl job=sendgmr) by 2002:a05:6a00:9a8:b0:6ea:8ece:3b3a with SMTP id u40-20020a056a0009a800b006ea8ece3b3amr198pfg.4.1712247921520; Thu, 04 Apr 2024 09:25:21 -0700 (PDT) Date: Thu, 4 Apr 2024 16:25:14 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240404162515.527802-1-fvdl@google.com> Subject: [PATCH 1/2] mm/cma: drop incorrect alignment check in cma_init_reserved_mem From: Frank van der Linden To: linux-mm@kvack.org, muchun.song@linux.dev, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Frank van der Linden , Marek Szyprowski , David Hildenbrand X-Rspamd-Queue-Id: 29926C002C X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: f3n7e17bt1xao3bk4tjro3pab8he1ftn X-HE-Tag: 1712247922-203303 X-HE-Meta: U2FsdGVkX19NbJ4iSVzhEWxT0GUFaETtHMEqQ5tdqKOPYbjGPJgNuYvW2Z7qciIdk9tNxuCXImn+IiI1aKJDqxgL0Xiabxmq1zq6F2frG0v0xwf9wVMCiHsDs9EbMdVzGqPB54MsecWWHcOPyGMd9k5ckwR1OSRhVNRpl14ZYopm6JPoCRINbCpfuTPRqrl5vn0HQ4B0cADgEH3GnGFebXDzy5PVwM6lpg7HbMKyOY9vp91qTJ+EfjunP/V9xcqfXE1n3v9Pn+3qQMvrJa6XNQufCwGyU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93oOpwJ/TgESPYH/UJgxzTSVgcWc7+I8HxdCBZvRrswFW3U87s1eOl01CVarYu9iHLCaAvSJYzql4XpEwLSIWNnx6v1RMBDF3M4CUHkOJ4JlCptmAIWuMX2bVEPcD9LmybGedyxRGmibB1GIh+qLyDqnrXJ3ztLWfq3aXb7nBOLVRhck55G2TEbLeqbqC7J1D1pz4d1PgqWi6zxOqXFfmPR1hNOUlgJQ0H529DM5aakHvKqH9eQEvszQmSpj62r7akxnBFUhiL/ai7VN+zbDmjPtNAIDgiarNibP1lvT67nw175GJvV9/016ZEoSkpag== X-Bogosity: Ham, tests=bogofilter, spamicity=0.001468, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: cma_init_reserved_mem uses IS_ALIGNED to check if the size represented by one bit in the cma allocation bitmask is aligned with CMA_MIN_ALIGNMENT_BYTES (pageblock size). However, this is too strict, as this will fail if order_per_bit > pageblock_order, which is a valid configuration. We could check IS_ALIGNED both ways, but since both numbers are powers of two, no check is needed at all. Signed-off-by: Frank van der Linden Cc: Marek Szyprowski Cc: David Hildenbrand Fixes: de9e14eebf33 ("drivers: dma-contiguous: add initialization from device tree") --- mm/cma.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/cma.c b/mm/cma.c index 01f5a8f71ddf..3e9724716bad 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -182,10 +182,6 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, if (!size || !memblock_is_region_reserved(base, size)) return -EINVAL; - /* alignment should be aligned with order_per_bit */ - if (!IS_ALIGNED(CMA_MIN_ALIGNMENT_PAGES, 1 << order_per_bit)) - return -EINVAL; - /* ensure minimal alignment required by mm core */ if (!IS_ALIGNED(base | size, CMA_MIN_ALIGNMENT_BYTES)) return -EINVAL; From patchwork Thu Apr 4 16:25:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank van der Linden X-Patchwork-Id: 13618053 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 B1AFBCD1284 for ; Thu, 4 Apr 2024 16:25:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47D826B009E; Thu, 4 Apr 2024 12:25:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 430016B00A0; Thu, 4 Apr 2024 12:25:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31C066B00A1; Thu, 4 Apr 2024 12:25:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0FFF36B009E for ; Thu, 4 Apr 2024 12:25:31 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 806681A0588 for ; Thu, 4 Apr 2024 16:25:30 +0000 (UTC) X-FDA: 81972374820.16.D3B36E4 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf01.hostedemail.com (Postfix) with ESMTP id A47A540027 for ; Thu, 4 Apr 2024 16:25:28 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=XUJEwpyF; spf=pass (imf01.hostedemail.com: domain of 3d9QOZgQKCJI1Hz72AA270.yA8749GJ-886Hwy6.AD2@flex--fvdl.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3d9QOZgQKCJI1Hz72AA270.yA8749GJ-886Hwy6.AD2@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712247928; a=rsa-sha256; cv=none; b=7go81xz+iiERjkylSnkz/n6cPgILVvzZBgSLmAcNCi129ARDjg77cbxqSiwruyX751jif8 3YDfF/8YmnaKsqFTjfZIQ3YYVtbjMRNdxdmsdc1YRxS/NBGUa6c/LJdLR9A14gzVSIH2cd 8R74UhTrU3kXgeGYAXOtMs0sUgcah8M= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=XUJEwpyF; spf=pass (imf01.hostedemail.com: domain of 3d9QOZgQKCJI1Hz72AA270.yA8749GJ-886Hwy6.AD2@flex--fvdl.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3d9QOZgQKCJI1Hz72AA270.yA8749GJ-886Hwy6.AD2@flex--fvdl.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712247928; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oHGbNzitA9ppM5Ku65CkqnyMFJ83UqBlfpZsb+skPp4=; b=WH8kY+y95addTGtMJZbLthpkpmx4TquwJ9tXwJa5m7ZwM568URK/FlEL20pTn3Z7S1/5BP Be24XkTqewdDn38EbhV4XMeZ/lKjSOEzv8OHg/EZyihDW3t3d46tHkJUbeyzJDw/tnnMfF LwANYt4CYkAZXXRHazNxu1J81nXWLUs= Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2a2f7048a7fso263966a91.2 for ; Thu, 04 Apr 2024 09:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712247927; x=1712852727; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=oHGbNzitA9ppM5Ku65CkqnyMFJ83UqBlfpZsb+skPp4=; b=XUJEwpyF3bVGULauZda1VVWasHYGCed9bg2x0WyVjYGB2V8xxOSDqf7AQBDgf8TObH DfasaVWy2RDLH2Xk5lSnZVZ9m/6yAQU/rP1Uobco52OwkEtbH6SK6CFqS+92mdCMmwUw 8KwEw5L0vKsZz4x1HWzGTFxdCcSlE7d+G3uu4iGKnYaogULew2co0elZYDMN9Q8nFo7t zOZn+bc2bg1sVEDizNqdCmakkR4lxcIzb3Y99E/AAsIpa8CWG9hHWOFFp1IrmFxljsie XOoghojpy0goLFVoR6TIDAtl2YEJCIgsctkYKe4mY62qF+QpvrCiQotMlBGGSYDsv7dw zEYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712247927; x=1712852727; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oHGbNzitA9ppM5Ku65CkqnyMFJ83UqBlfpZsb+skPp4=; b=PGN+IgDwSDp356G1MS5f9tAhmFxUEYLrysTQseMntnjVsUpncPqo7M7gBHBbjEjafP vPMH/cSu8ZY40nop4ZMUltDSMp8iRDF5CnA/TI2FTzUfrci8tLVAogPugRMOuD3S5cYE b0jYP6NBwqd2UURmVnWLRpBnFPjmT+mBK7bTu2EvihgsDhrYoPupl6ndGeJBd0704WaJ BIXSATk7Ah8lbgs+ZVSQVRw7pGq2tpDYM9z1QVfPO5575ERamjNCgqf1RTjVLw6400rR qkTLr1DVZWIKP/oprgcfeSFAhhiN147OZl4aMkkjvSZ8RNiWonNOpAGXvII9wtJ7Npko kp6g== X-Gm-Message-State: AOJu0YwPNgUa2v8mzd/L2Sxu93sjYP7wN9Gj4UKENCt2GgLSn6TLfGaE ukyccFNG9DDBhGPR2TUA5Vmml8y4JhRoXOI1oxMHth00PXR6eiPRlSHPTGQ44/wSeCG3Boc8x0c 3tDuowHk3PYmPrAb4RipPIabzNIQ7oDlBOJ+2Heq8SFIeAQs2aKQvHxrJ7z2hw2hPYpbC2Wnztd 3igqiuu/UZKWWKBoUy X-Google-Smtp-Source: AGHT+IGXnTdJEgMY2tAcjsPsMJtWw5f7/a3l2Iy2vxpUruJLqcHR32OpW+y0OGvqY2PVU1UyXbfKojhA X-Received: from fvdl-cloudtop.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:46ab]) (user=fvdl job=sendgmr) by 2002:a17:90a:6d64:b0:2a2:1014:58be with SMTP id z91-20020a17090a6d6400b002a2101458bemr363pjj.7.1712247927255; Thu, 04 Apr 2024 09:25:27 -0700 (PDT) Date: Thu, 4 Apr 2024 16:25:15 +0000 In-Reply-To: <20240404162515.527802-1-fvdl@google.com> Mime-Version: 1.0 References: <20240404162515.527802-1-fvdl@google.com> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240404162515.527802-2-fvdl@google.com> Subject: [PATCH 2/2] mm/hugetlb: pass correct order_per_bit to cma_declare_contiguous_nid From: Frank van der Linden To: linux-mm@kvack.org, muchun.song@linux.dev, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Frank van der Linden , Roman Gushchin X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A47A540027 X-Stat-Signature: 6huztbk9unegswkwci8zf4xoxqj1e8d6 X-Rspam-User: X-HE-Tag: 1712247928-859681 X-HE-Meta: U2FsdGVkX1+bX/sdD6RJ7CpWoc55UujR/gmERhn7TxqOr0Kc+4NDpt2KPCsXZ3RKvSDbpdOkXDR/pmeR+yUAsjSSw5LX4iOXS55ZvBlImgL9pUHnDIeYsuY5FmCq+RQroT4e9cDphn/W8eccHM0I3nPQN9Ob/Zte3Gz7Jq/zMPRK6N01yDMiEm9Objz/D7k+ytFWNCJTwJVVc+8184IgqtPDTRAe5UBpbIyAJbqvODMREFx99PKINQ2iBD60m+78FyEmmKFMrho7ZZQWYYx6cS+su7XfDNqS+qUgwWtu9J4otr8Svuu8o/TgI+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aAKyHt/hhbOwokVOemXRGjvKUPjWYyPA/A2Qe8DHA1w1rLzfo8EF5DiIFgP7HFfAYFJeKuAkPaCtGH6EFvm9w2eIQ2K+nZOuDR0JxnEbWjJCEwR/AsC2orhjej/nMnXHCtFhkSLjLpJlI3I6xCMbtnGaOzvjmlOvENGu6AZcNk7ySKf5O4DlMcEcoIqHBq0tKCxbDZXMMf9Ltvu8ArHhG/1CcGs12N/TmcCFe1Av8K1 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000014, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The hugetlb_cma code passes 0 in the order_per_bit argument to cma_declare_contiguous_nid (the alignment, computed using the page order, is correctly passed in). This causes a bit in the cma allocation bitmap to always represent a 4k page, making the bitmaps potentially very large, and slower. So, correctly pass in the order instead. Signed-off-by: Frank van der Linden Cc: Roman Gushchin Fixes: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma") Acked-by: Roman Gushchin Acked-by: David Hildenbrand --- mm/hugetlb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 23ef240ba48a..6dc62d8b2a3a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -7873,9 +7873,9 @@ void __init hugetlb_cma_reserve(int order) * huge page demotion. */ res = cma_declare_contiguous_nid(0, size, 0, - PAGE_SIZE << HUGETLB_PAGE_ORDER, - 0, false, name, - &hugetlb_cma[nid], nid); + PAGE_SIZE << HUGETLB_PAGE_ORDER, + HUGETLB_PAGE_ORDER, false, name, + &hugetlb_cma[nid], nid); if (res) { pr_warn("hugetlb_cma: reservation failed: err %d, node %d", res, nid);