Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2012543lqp; Tue, 16 Apr 2024 05:07:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyXt27c3NtuNeTJ6R7jMVqoRyC2wl/8P4Y8tv6kftXU5PEJyush2l+XmbhoLq1DtYiQTFQij71nBkXA6BsNOY1X7KplPyxxQbPkwmsFQ== X-Google-Smtp-Source: AGHT+IFN61NaLBRBA5vbZw5KrYW4AAiXc/Fv2PZQymACDfu+a3x/lS2hPDaHRkUWi6ikcOB7U8fL X-Received: by 2002:a05:6870:e09:b0:22e:d13b:c13d with SMTP id mp9-20020a0568700e0900b0022ed13bc13dmr15847101oab.18.1713269264883; Tue, 16 Apr 2024 05:07:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713269264; cv=pass; d=google.com; s=arc-20160816; b=Cv2aFjfjmq7+hs3b7fOoAtaDHG5HY98p3OTaKCAT1mab3OFFJPF1t9/Y/p2BmU11tV pS0A3heucKlLbcxHPZr+0oNMQe5nJ8EWSUMgU+H2GCUOOXz9Ih0paN4R6xdyVRYNTR97 Xxl39BpOX+kkLkjI8BsgiKRad1v/Nt0pLsthdkDtO5n89B5A+2+LJe41br+oqbvP7TGp R8N58EbpZhFf9V/DNKA4CDUEExbcA8+F5F55SOWrZJLcqSs+lHS63/5FPdXGQ+CLwqLh YFZLxPkPsNi92GxOoOrIzjEnGFz2OCh9xwpneFt/hV1MArhQrK6rD4i9CzNvmgdYgyoR hzVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5bxCFPrPN7YYp9G6q6vxreo9zNUW585IcR1CQUImrPQ=; fh=O3xssQ2mM/ZxSttNdd8cxnoXWisOPVOdlcmqqvFYU/k=; b=hz5JXT4W8UBnmRP3GXhK90CR8K5C7DWBTfl5OB1eJHb1jXq7bBUcrVwvLj4NA1ULXf 44KTiqXqkJt/dYNH7r+NzDc9xi+CcobRzaSDtqn1xbVhndIP6lD0xUdRr6q2hwgfnDJE /olUX+rLdBqZiWTyGUIFjGJlwsxT9xC6MMto6nJ/g5Ceq9MrdsvbhVg1DpnCRPAwNuHY OByvOoN5xQM5PTSvVTAV+3dzCQeiPO+DPPIu9uKKpNEWTWD3SCJzqlpL6lIVlspeZ7NL 1g8xqGWIp9MZJcn1oBwNPs+v1m6Qt74BGZ3QZ6JC6IMRFeo1e9uEoDRYIaZXcxWGUlOr hyfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q6R8VmxA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-146746-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146746-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x189-20020a6386c6000000b005cd82e43aa3si9274022pgd.321.2024.04.16.05.07.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 05:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146746-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q6R8VmxA; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-146746-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146746-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E239BB2180C for ; Tue, 16 Apr 2024 12:07:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71EF812A172; Tue, 16 Apr 2024 12:06:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q6R8VmxA" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46D896D1BC; Tue, 16 Apr 2024 12:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713269217; cv=none; b=cwQcMt3avox2sUpTbINcKKqIJvCAMl5mKre9gx7XsdADejJVHC9mgy2JRY00GHlSfu4TbHnUeBC/DRhq9+5JuW7Sma5XAAmy6F/KD6fH45SeppqujxU1E6WMl3Nw8vITAtwP4f+NOhmVweJFjPwNoiEpLDVMnHr4u4TdbmymDo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713269217; c=relaxed/simple; bh=aLGjwKsUkhJyDnihkDIIByyYkg6df93bUPXuv1sTlYw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FxRDTcg6gEI18xy/v84KvoJ+xnNqKg0kW11HJxNwuo0hPkIRHG5iizQllzO1ncQBT1cp1MTgJowFUPzMg8s63LQIzskN3FMBiZi/UuEdlLEB09LeQuem8aA5N/v9c/TI/nKVt3qTGtVK14c0HleGMLsVR5j9D2/aXufimQeCBvA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q6R8VmxA; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1e3ca546d40so30651725ad.3; Tue, 16 Apr 2024 05:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713269213; x=1713874013; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5bxCFPrPN7YYp9G6q6vxreo9zNUW585IcR1CQUImrPQ=; b=Q6R8VmxAdY4Pt2XUpv6pcrpSQ1+YI+Ba+uHmHjzl10T2QLlic3Fq8rQEXUdKvb7+Ne Hzb0TxMXjTo4p9uRT4wHQw00bOkLkKCEmvKa9RTTzBaE95mbOpz6j3fXtG3/DJZEIngN WhF+NgtXkQCBPD/QBHeVosA/+HMxfGUCMbIsI/na14hI7qBobAWUb7SsuV0/IHFqE0aW SWNXKM5WKOL8UCBK2Xn07x0PX4ypYuB2eDME6NLNUSnCIQ73EYsfIFZq/2xi4skVZf1I bsBLDfzMxp6EBNCa6gGiUIpoOLphbRf7xk+hNYrG3vKDimYVYkYu6zCN+AbGI++9V5Eo RDMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713269213; x=1713874013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5bxCFPrPN7YYp9G6q6vxreo9zNUW585IcR1CQUImrPQ=; b=wKHDc5qZWkZe/E3BnInD7qreZC9QdAIJnuQ7NzU6mOjkJ7X64a+u4v2T0YtE/aLWm2 39yqBlsRU+7tmaiR50KdU/JYEvVX6J66aK20g3zOxewZfPEyeNCSL3t29AT/1yY2C5Py ZWKoXkMazGQdIHBrN/mBNqVebmykx1TnL4fQM6bOtzBxMZW8EWR3Ls0lIf52/9rKQWHE j4qwSwLxIZEy4osGzaWWSkOeA5eI4LvB/4GSwROfG/ddTW56LPb52U2xujwxUF190o5O oQfhuL8BRQylD6CvzNdyqmPR30jjrd7pkHYDBqzlgDfRemI4Dek4I/v6wYR0Be03ZVfT G2gw== X-Forwarded-Encrypted: i=1; AJvYcCXlyLhe74eGBTvYtKcd7Vw+R7njIGDPuOKkP67d6/j/xIG6ikxjTsJxHPfUNLYYyhsHRCOudEBusHsD9PrMLwQXOaPZbX/m4wQ+NC1D X-Gm-Message-State: AOJu0Yxxqk5af00seGx9GUr84U5m17oyB9p28F1cZsuyPelpam7UlTF+ wAsVPJZyuEVrzop6yaODcbJO7tTQTFjW8lH0CtUxPrGEBX8/KauM X-Received: by 2002:a17:902:e9d4:b0:1e4:1bff:1f6f with SMTP id 20-20020a170902e9d400b001e41bff1f6fmr9339067plk.50.1713269212500; Tue, 16 Apr 2024 05:06:52 -0700 (PDT) Received: from localhost.localdomain ([49.142.40.215]) by smtp.gmail.com with ESMTPSA id b11-20020a170902650b00b001e509d4d6ddsm9813684plk.1.2024.04.16.05.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 05:06:52 -0700 (PDT) From: skseofh@gmail.com To: robh@kernel.org, saravanak@google.com, rppt@kernel.org, akpm@linux-foundation.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2] memblock: add no-map alloc functions Date: Tue, 16 Apr 2024 21:06:34 +0900 Message-Id: <20240416120635.361838-1-skseofh@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > > From: Daero Lee > > > > Like reserved-memory with the no-map property, there are memory regions > > need to be allocated in memblock.memory marked with the > > MEMBLOCK_NOMAP flag, but sholud not be allocated in memblock.reserved. > > Can you please explain your use case? > Why do you need this functionality? Thank you for your comments. I added a example to the commit message. > > So, functions were added that find the required memory area in > > memblock.memory, but do not allocate it to memblock.reserved. > > > > The early_init_dt_alloc_reserved_memory_arch function was modified > > using the no-map alloc function. > > > > Signed-off-by: Daero Lee > > --- > > drivers/of/of_reserved_mem.c | 9 +++-- > > mm/memblock.c | 78 ++++++++++++++++++++++++++++++++++++ > > 2 files changed, 84 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c > > index 8236ecae2953..504f2f60689c 100644 > > --- a/drivers/of/of_reserved_mem.c > > +++ b/drivers/of/of_reserved_mem.c > > @@ -40,15 +40,18 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, > > > > end = !end ? MEMBLOCK_ALLOC_ANYWHERE : end; > > align = !align ? SMP_CACHE_BYTES : align; > > - base = memblock_phys_alloc_range(size, align, start, end); > > + if (nomap) { > > + base = memblock_phys_alloc_range_nomap(size, align, start, end); > > + } else { > > + base = memblock_phys_alloc_range(size, align, start, end); > > + } > > + > > This changes behaviour of internal function, what effect will it have on > the users? I added explanation about this to the commit message, too. Thank you.