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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF945C5AD4C for ; Thu, 23 Nov 2023 10:12:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 513A96B0662; Thu, 23 Nov 2023 05:12:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C34F6B0664; Thu, 23 Nov 2023 05:12:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38B9D6B0666; Thu, 23 Nov 2023 05:12:57 -0500 (EST) 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 2819D6B0662 for ; Thu, 23 Nov 2023 05:12:57 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id F0E05B6738 for ; Thu, 23 Nov 2023 10:12:56 +0000 (UTC) X-FDA: 81488805552.17.1AFAB7D Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf07.hostedemail.com (Postfix) with ESMTP id 1707540014 for ; Thu, 23 Nov 2023 10:12:54 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IkTJti9B; spf=pass (imf07.hostedemail.com: domain of fancer.lancer@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=fancer.lancer@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700734375; a=rsa-sha256; cv=none; b=5yuF51aQGhjWLCUsvuiW4Ttn0NLysP0Oc2XfHz6Gw1D0OF9isBFFHnB9ykqFXtDChsJVrs l1fVT7kHGFEKTpAcntSYgbH/fPeOz4RdC3VLOfloucUDAN/1hW+1Rx4sLMEJCeu74mv7wJ QVWZH9HbkPCudsr0Do6K58auGXnBDnc= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=IkTJti9B; spf=pass (imf07.hostedemail.com: domain of fancer.lancer@gmail.com designates 209.85.167.52 as permitted sender) smtp.mailfrom=fancer.lancer@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700734375; 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=eSzcGsR12Bka54XZ6rswtH5TghxihsOmy1TzXesau9Q=; b=lVg3vCrryY6CMbtdK0xQ7fSyvdgLsRSKzy1WSEF3aRt4GVesLcjZawu3+8w5E+nQScHG5S +sZAeZtgHOecy+JtW/UaC7Kxi1Lu6wbLb3Ng6skcEV49auYU3uhOy+hx/HJ7kl60qGc114 oFdNHOZtb8MGcHHQAGZA7z/b1kHP4lE= Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-50a6ff9881fso964312e87.1 for ; Thu, 23 Nov 2023 02:12:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700734373; x=1701339173; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eSzcGsR12Bka54XZ6rswtH5TghxihsOmy1TzXesau9Q=; b=IkTJti9B/cSR5NZd6DejhWaFkWDuLL4n7bN35YVdD5HGjx2khpJ0kHI561Oj4NCIs7 u67m8R4v8QQKA+btrsTReqPXHbTMFSqYPoMkCyieAJR7yRtamDZRD5UAFvie3PUed9i4 4QJFl5Gu/4sZJ9VTGA5aHrHPUxrs18kb3HhpiFXM+/19h/KhMnBB/R6TCyMhrG2GHcsB 4nA8kA+QzPJMP+S7D5QFruYmI9hAF7BwwRQMcYS2pl6E9unDvc8KuxK5JblKfPtXRh1S Vn7kuMNS1vi8DPPOilYtWKqsTl2Xn7ysR1CPngxxyNQEAR6LI0wRl0h1ruYSqleGm6Om GoYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700734373; x=1701339173; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eSzcGsR12Bka54XZ6rswtH5TghxihsOmy1TzXesau9Q=; b=afy6NX31/Zl6Rqc4bXEuLoN6TnOK7aJU51ddThEABVI6evs0d03knSEh0TA2Aat8rT F4l8kcbI+7Kbi+jVKKLFCayLSBX6Thp4jU7eAAgBZTGoPTYw4WclT+U7zZp22Mp+T7aq 55E53uc6lgo5F7PgQA+Wr4h+Fkkv/kUsFgRz1JIwUoEd53uKZPXubwUqvL7dUEKn5Py4 DH6o93Ey1Aj4oWS1D4XRuo8rESGbSHSDxMa2DyULCx6y/KM/YkHflfG0Q3JT/ulnUOD+ 8Qc4AYSuEPUK9L4mAgasAXszVs07zwXlqKd0YKiErfS8L0gcjxYrsC9cnsTpUe4oCXyQ YIhQ== X-Gm-Message-State: AOJu0Yw5x72otkXy9lF/+57iu4dUeTg6E7T5qYIBJ8UsTscCfEjgrG73 TuFqRHldQ97XuIYn9GoSMHM= X-Google-Smtp-Source: AGHT+IGuVcMYF1AJtvzoDCxh96M1MRBrGHqCQvxbVJiV87fxLcd1l+rahWb0etAmuYGzUHsYHcsCOA== X-Received: by 2002:a19:5519:0:b0:504:4165:54ab with SMTP id n25-20020a195519000000b00504416554abmr1920923lfe.56.1700734373112; Thu, 23 Nov 2023 02:12:53 -0800 (PST) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id i33-20020a0565123e2100b0050aab0d19e3sm143778lfv.123.2023.11.23.02.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 02:12:52 -0800 (PST) Date: Thu, 23 Nov 2023 13:12:50 +0300 From: Serge Semin To: Andrew Morton Cc: Thomas Bogendoerfer , Mike Rapoport , Matthew Wilcox , Alexey Malahov , Arnd Bergmann , Aleksandar Rikalo , Aleksandar Rikalo , Dragan Mladjenovic , Chao-ying Fu , Jiaxun Yang , Yinglu Yang , Tiezhu Yang , Marc Zyngier , linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/7] MIPS: mm: Fix some memory-related issues Message-ID: References: <20231122182419.30633-1-fancer.lancer@gmail.com> <20231122102900.68216218f77b61e342f37627@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231122102900.68216218f77b61e342f37627@linux-foundation.org> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 1707540014 X-Stat-Signature: dmc91pf6abnezgpp51abngq9pxcxfzxt X-Rspam-User: X-HE-Tag: 1700734374-245757 X-HE-Meta: U2FsdGVkX1+PfR9QJn3CekvARbULGZVl5rFjec2PRvh7a0ZscFk9g4Ky1ZJoLA+qn4ngI30ynWS3UOC8YdA4gJB6PQEdlUYhYoVYLFQopnLSDwGYmFujl5i9sUykBk/Kp1hp5sdPud8YraBsEnwRukmuJuTbeVI/HvZ4JF+UvCoXRcBlX9Oi1YmT6iIno4f+gpt+NlS1QNVNL41fcb09EWH8/Mu3a9DlNCFC2cZI7klwsmWjRVTAcG+IYUCeGQ5RLWUakdkWQPcWwu8eTWpiL0s7YElV1xYvjEXAuFLf6BKRtsmRPDp+CXZk9y8zdKokJqUvIr1fcqvOikQ7oBngvrNR+pAVVZqznHUvrsB5FxAoJAENIs8itQWDAJRbfS68Igfi39XBt7+Uc1L9dk1qSl9UkSktMp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y9nyy8EKQQCLcMdPakhPhjzb0PcP6Y/1dD5REpw6igzIHF7HujCDI/e58FOmfo4i9vWoTJAN8royQhmJ7jT09MTvHTqmX/ 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: On Wed, Nov 22, 2023 at 10:29:00AM -0800, Andrew Morton wrote: > On Wed, 22 Nov 2023 21:23:58 +0300 Serge Semin wrote: > > > Just recently I've rebased my MIPS32-related work from kernel 6.5-rc4 onto > > the latest kernel 6.7-rc1 and immediately got into a bootup-time > > mm-related bug (see patches 3-5 in this series). After fixing it I decided > > it was time to submit for review the generic MIPS code fixes which I have > > been collecting in my local repo for the last year. I was going to submit > > them a bit later after I finished working on a patchset with my SoC > > arch-specific changes, but since it was getting bigger and bigger, it > > turned to be reasonable to spill out the generic part of series right away > > especially seeing it might get to be useful in the most recent kernel. > > It would have been better to separate out the two tiny unrelated MM > patches from this series. One of them isn't completely unrelated to the series content. The biggest problem I fixed in the patch [PATCH 3/7] mips: Fix max_mapnr being uninitialized on early stages Link: https://lore.kernel.org/linux-mips/20231122182419.30633-4-fancer.lancer@gmail.com/ of this series. I was sure that it was a correct fix at least for having the pfn_valid() method working incorrectly, but I had doubts whether the memory mapped IO pages were supposed to be left uninitialized by the arch code relying on the init_unavailable_range() doing that especially seeing it was printing a warning about having unavailable ranges. If it turned out to be incorrect I would have needed to drop the patch [PATCH 5/7] mm/mm_init.c: Extend init unavailable range doc info Link: https://lore.kernel.org/linux-mips/20231122182419.30633-6-fancer.lancer@gmail.com/ and fix that problem too in the framework of the MIPS arch. My alternative assumption regarding that problem was that the arch-code should have used memblock_reserve() method for the IO ranges, so then the calls-chain: mem_init() +-> memblock_free_all() +-> free_low_memory_core_early() +-> memmap_init_reserved_pages() +-> memmap_init_reserved_pages(v) +-> for_each_reserved_mem_region(region) +-> reserve_bootmem_region(start, end, nid); would have properly initialized the IO-pages reserved earlier by means of the memblock_reserve() method. But it turned out that reserve_bootmem_region() was available only when CONFIG_DEFERRED_STRUCT_PAGE_INIT was enabled which didn't seem to be widespreadly utilized in the arch code. Not finding a better option I decided to stick to the solution relying on the init_unavailable_range() method doing the trick and just fix the method kdoc. Seeing you accepted the patch [PATCH 5/7] mm/mm_init.c: Extend init unavailable range doc info it was a correct decision. > I'll steal them - if they later turn up via > the MIPS tree then that's OK. Ok. Thanks for picking them up. I'll drop those two patches from the series on v2. -Serge(y)