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 8DF3CC7618E for ; Fri, 21 Apr 2023 16:32:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2BF16B0071; Fri, 21 Apr 2023 12:32:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDCFF6B0072; Fri, 21 Apr 2023 12:32:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA2BF6B0074; Fri, 21 Apr 2023 12:32:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CB67D6B0071 for ; Fri, 21 Apr 2023 12:32:41 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 905C212054B for ; Fri, 21 Apr 2023 16:32:41 +0000 (UTC) X-FDA: 80705941722.17.F2370DA Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by imf27.hostedemail.com (Postfix) with ESMTP id 8C88340023 for ; Fri, 21 Apr 2023 16:32:38 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=IIgMXIAs; spf=pass (imf27.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682094758; a=rsa-sha256; cv=none; b=pd38bnJcJCyoM5lvYrAus89te8lxWQJD0OBfl4E2ojFqtQEVmL/5nmwzSQS9y+82p4T+3I 2EbsVBX7ICTs2LJzatDl2uELKpBFrRl6rWHOEC5YjbK26CsmvR2daj57pzasBOlIpi6DQY 0Cx1UpUsJsOWu98P5PycbBiUB3+vqoE= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=cmpxchg-org.20221208.gappssmtp.com header.s=20221208 header.b=IIgMXIAs; spf=pass (imf27.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.170 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682094758; 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=9yla/4p2oOldTOYUR/tBNrxjFRWDCxFy5rsjLcKDZm0=; b=0THAbbFvynwOewjsMw2WMg6J9WQROXzqDKhA8Wk2X6awYu0eb4TChKi6+d2EUj4agixqIQ y8KOTdjNggCsQZRZXDCj0xmfgqjLat1tw6mayjs8/6TuAh1rpBwjFWlrcBdiIvA6IY3Mmj J64vaFqpZqKDWlkTfC4aYJwpfL8vM1o= Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-3ef2f81a96cso21590951cf.0 for ; Fri, 21 Apr 2023 09:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20221208.gappssmtp.com; s=20221208; t=1682094755; x=1684686755; 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=9yla/4p2oOldTOYUR/tBNrxjFRWDCxFy5rsjLcKDZm0=; b=IIgMXIAsLX6acEerwuEG1+MjsTqE3bx1KI0BxQfpjUAmK3E6dBjQ0RccgOa2SFlESk jMabF1fjcn8hswczr7Qmr1M5ZMln1zLje4A+Zi4oc4mcaLlGdvf+BM1WelSpNQCCx3i6 MpPfs+g5ViS6y1PZ/Z22tw2a+1h1tQVuiZ7Za4ovAwVlPbNQcKUF1xczcdKtGDvoXMiF JuNzCwCDr9vP2zwkLYCJxorm3dprSxwSg38Cr6rrcj4woDTHeyv6FKg2nPQ23D1uGqcT pSrDcQnMvpwrZvEommOhMCGRGPaXVz+MYgON0XhPllfJxYeTBUlNDq9ZwohH/H/huVom dowg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682094755; x=1684686755; 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=9yla/4p2oOldTOYUR/tBNrxjFRWDCxFy5rsjLcKDZm0=; b=M2EqcWLztPLhg5nBiYx9VqApWZcoMLaIiZ98FN1+YlHbM/ku7iH44DsVlDd6eI2gck Cu3pngY5xcqqadaJPc69NHEcS5XQMMSKwLNgOv46NVk5C/gqbXyOwxMRdI0sq76gNQwh Au2bCQ7m5FkCMNt3UkypNZyGmd4nLwVklxjaSu8IWQGm/UxzRl5fmLTSq9QbVqbVS0S4 Y22pMauyGulgj0HVEWXpzBavGaUotfp0ZtRnjKbe//6cC8gviZACFGVHnd1pYW8jyt17 uPCEB1O8uE+ef0SKEU/cAKmBGDe4KLKIvNIFPhPGqGA+Dqd6dtpeOXRRUMeyyvJtz/wn 1G3w== X-Gm-Message-State: AAQBX9c5Aw6uJV4Iq+QW2ZEB9PjuBMZ2FK7Bv3IaDuMYLPy/HBhLqEBB IHwTSDt1Yjf93+IUIYtgaN02EA== X-Google-Smtp-Source: AKy350bj3/K/tk2k4WizRt2yPrEl47IiwR4WqXmA0klRcGVpUS135pGT1DB1cqHqXdDI0Exxp3B+5w== X-Received: by 2002:ac8:5f0d:0:b0:3ef:2fbd:90c3 with SMTP id x13-20020ac85f0d000000b003ef2fbd90c3mr8748270qta.37.1682094755652; Fri, 21 Apr 2023 09:32:35 -0700 (PDT) Received: from localhost ([2620:10d:c091:400::5:6f0d]) by smtp.gmail.com with ESMTPSA id b142-20020ae9eb94000000b0074cd846d215sm1447569qkg.64.2023.04.21.09.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 09:32:35 -0700 (PDT) Date: Fri, 21 Apr 2023 12:32:34 -0400 From: Johannes Weiner To: Mel Gorman Cc: linux-mm@kvack.org, Kaiyang Zhao , Vlastimil Babka , David Rientjes , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 12/26] mm: page_alloc: per-migratetype free counts Message-ID: <20230421163234.GF320347@cmpxchg.org> References: <20230418191313.268131-1-hannes@cmpxchg.org> <20230418191313.268131-13-hannes@cmpxchg.org> <20230421142841.parju3gmqmpefigq@techsingularity.net> <20230421153501.GE320347@cmpxchg.org> <20230421160320.zz2he2iprq37vnl3@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421160320.zz2he2iprq37vnl3@techsingularity.net> X-Rspam-User: X-Rspamd-Queue-Id: 8C88340023 X-Rspamd-Server: rspam01 X-Stat-Signature: 63zwyhpbtyuw1qccnckb5meq3dzeqaxe X-HE-Tag: 1682094758-931977 X-HE-Meta: U2FsdGVkX18CRh8e5NGobzkb9lS2yPkAGAbP4Pk9Y6qHPF9A/m6xbga4pPiao4abQT54zc1KBFenZpck9X7UQCHlfTFSb1L1wVF2XPcacN9INkgpMdHBu6pK4xeq3QZ5KAjkKicBt61i3h2BkK365pxh8ry8Bpvrcv0uLabMgUJNEhn0AoW+0I1kQlxIumlSvJk050pyLD4bpY+7mbWMb58/vkpuV/EZNE8612MAc4vuRrh9/mldvHq5f8YTxMPVAcX8jcyJPpErsCiZyhUZkguFCBG4YQxwFBWhNgHYMry6WAwuY6/C97sbtOIf0IS5YfQM6pDseaLWiM5HYqHPkhBbiPsKduy9Wt02P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KSxSAJPqb7kuUdRj5zYWghJrvR2v7NsM3GbqC6apRkXVyg2tsDrm1mCgTE8qmE9rxtI/g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000152, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Apr 21, 2023 at 05:03:20PM +0100, Mel Gorman wrote: > On Fri, Apr 21, 2023 at 11:35:01AM -0400, Johannes Weiner wrote: > > On Fri, Apr 21, 2023 at 03:28:41PM +0100, Mel Gorman wrote: > > > On Tue, Apr 18, 2023 at 03:12:59PM -0400, Johannes Weiner wrote: > > > > Increase visibility into the defragmentation behavior by tracking and > > > > reporting per-migratetype free counters. > > > > > > > > Subsequent patches will also use those counters to make more targeted > > > > reclaim/compaction decisions. > > > > > > > > Signed-off-by: Johannes Weiner > > > > > > Visibility into fragmentation behaviour is information that is > > > almost certainly only useful to a developer and even then, there is > > > /proc/pagetypeinfo. At minimum, move this patch to later in the series > > > but I'm skeptical about its benefit. > > > > Having them available in the memory dump (OOM, sysrq) was essential > > while debugging problems in later patches. For OOMs or lockups, > > pagetypeinfo isn't available. It would be useful to have them included > > in user reports if any issues pop up. > > > > OOM+sysrq could optionally take the very expensive step of traversing the > lists to get the count so yes, it helps debugging, but not necessarily > critical. > > > They're used internally in several places later on, too. > > > > I did see that for deciding the suitability for compaction. Minimally, put > the patches adjacent in the series and later if possible so that the series > can be taken in parts. There are a lot of patches that should be relatively > uncontroversial so maybe make "mm: page_alloc: introduce MIGRATE_FREE" the > pivot point between incremental improvements and "everything on and after > this patch is relatively high risk, could excessively compact/reclaim, > could livelock etc". Okay, I see now where you're coming from. That's good feedback. Actually most of the patches work toward the final goal of managing free memory in whole blocks. The only exception are the block pages, the nofs deadlock, the page_isolation kernel doc, and *maybe* the should_[compact|reclaim]_retry cleanups. I tried to find the standalone value in each of the prep patches as well to avoid forward-referencing in the series too much. But obviously these standalone reasons tend to be on the weak side. I'll rework the changelogs (and patch ordering) where applicable to try to make the dependencies clearer.