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 X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50D49C4743D for ; Sun, 6 Jun 2021 21:31:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E035761408 for ; Sun, 6 Jun 2021 21:31:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E035761408 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1B6826B006E; Sun, 6 Jun 2021 17:31:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18DF76B0070; Sun, 6 Jun 2021 17:31:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 056326B0071; Sun, 6 Jun 2021 17:31:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id C880F6B006E for ; Sun, 6 Jun 2021 17:31:21 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5C5C4B79A for ; Sun, 6 Jun 2021 21:31:21 +0000 (UTC) X-FDA: 78224595162.30.89C484C Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf30.hostedemail.com (Postfix) with ESMTP id 2E16CE00026B for ; Sun, 6 Jun 2021 21:31:20 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id AEFDA613B6; Sun, 6 Jun 2021 21:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623015078; bh=ZtDz+Tx3gDJURxeLGuynFGZ8uxab5SNEIC7k5srsrBY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AHcE9g6brTgSAV+4xVNhxekKQlGM0mhAwBWD7XpWpqvtSKGR2QVl9LLO9Fp8mdhc+ pc81xS+K6zgxjC9BvkiLbrgqfQSTHMEsv0LbOBaFKiII1tEOu5/8nloj4MSsU82HIa zrNuIDNh84AL4LuphasPGIwe4LNbg9inob5KFPcyQWr6fCOpQ1hseHxL1zqLaM0xud rcUhT1KG4HC3/rPAMCNByPC09q5k03V88CjP/YnrWLRCt6Qt1kUehiQTJUTNwYN4hW To0R1RL/ILuw03NT52wJ9AiDWAT36NN77oYd2Bnz8ID2ZeewkpMb92YVMYNyVavhgv L/9jySVl4Hzcg== Date: Mon, 7 Jun 2021 00:31:09 +0300 From: Mike Rapoport To: Kefeng Wang Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-s390@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper Message-ID: References: <20210604070633.32363-1-wangkefeng.wang@huawei.com> <20210604070633.32363-2-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604070633.32363-2-wangkefeng.wang@huawei.com> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2E16CE00026B Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AHcE9g6b; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of rppt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Stat-Signature: ukty5x3zxxzewo6ud1fk3ku4r69gzxu3 X-HE-Tag: 1623015080-556503 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: Hello Kefeng, On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote: > Add setup_initial_init_mm() helper to setup kernel text, > data and brk. > > Cc: linux-snps-arc@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-csky@vger.kernel.org > Cc: uclinux-h8-devel@lists.sourceforge.jp > Cc: linux-m68k@lists.linux-m68k.org > Cc: openrisc@lists.librecores.org > Cc: linuxppc-dev@lists.ozlabs.org > Cc: linux-riscv@lists.infradead.org > Cc: linux-sh@vger.kernel.org > Cc: linux-s390@vger.kernel.org > Cc: x86@kernel.org > Signed-off-by: Kefeng Wang > --- > include/linux/mm_types.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h > index 5aacc1c10a45..e1d2429089a4 100644 > --- a/include/linux/mm_types.h > +++ b/include/linux/mm_types.h > @@ -572,6 +572,14 @@ struct mm_struct { > }; > > extern struct mm_struct init_mm; > +static inline void setup_initial_init_mm(void *start_code, void *end_code, > + void *end_data, void *brk) I think it's not that performance sensitive to make it inline. It can be placed in mm/init-mm.c with a forward declaration in mm.h > +{ > + init_mm.start_code = (unsigned long)start_code; > + init_mm.end_code = (unsigned long)end_code; > + init_mm.end_data = (unsigned long)end_data; > + init_mm.brk = (unsigned long)brk; > +} > /* Pointer magic because the dynamic array size confuses some compilers. */ > static inline void mm_init_cpumask(struct mm_struct *mm) > -- > 2.26.2 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv -- Sincerely yours, Mike.