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 14F05C433F5 for ; Tue, 8 Mar 2022 23:50:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 890538D0002; Tue, 8 Mar 2022 18:50:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 84AE28D0001; Tue, 8 Mar 2022 18:50:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E31B8D0002; Tue, 8 Mar 2022 18:50:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 5B7158D0001 for ; Tue, 8 Mar 2022 18:50:01 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2701F2065D for ; Tue, 8 Mar 2022 23:50:01 +0000 (UTC) X-FDA: 79222864602.12.EB2DBD0 Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by imf17.hostedemail.com (Postfix) with ESMTP id A3C184000D for ; Tue, 8 Mar 2022 23:50:00 +0000 (UTC) Received: by mail-yb1-f169.google.com with SMTP id u10so953217ybd.9 for ; Tue, 08 Mar 2022 15:50:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6blG6EAzX4w/WH2eHf6lZLaVJfDBuoOmPYe51zQt/4A=; b=V39oqsH8PidHbrDaeyYTPlj2xsTvihPzTyN3cv91d+WXA3fnkhlv/m377gWtuzDsW1 N+UDbiIOoqMlomI5DPKFmOHepNc1QiVzaQtNWW59h74OSDKEKok24ndZz+aiTXXsIqvi edgKHFlHEnHob8ds7KamIk0IoygOYIRjIAWfH5+ooKI/B3438XnSNQnFCDvOc9Bwih74 3hlTQbpsnTKyvSRPdyJs3pVAl6GEN0sOR0pKI2d9zxCd/CyBxMhiLkLeIlSW7+LUTkPB SQUWSCOThdhBFxBgonCR0fe+eCBmIa5e/5TJHAnCo24qKGje3VPimwIZSCb6zy/sOkZP wmwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6blG6EAzX4w/WH2eHf6lZLaVJfDBuoOmPYe51zQt/4A=; b=0/8n6inAzgWxPPfW7Sxieodgq9vo2UWffrTo2ng4y99UC0HFVRMeAaGPMIRyISFc0l 4ZsDx7qaPhj8/YjvhpNhSvOeAad1EZeV1KNrUlm/GKD55SVDjjTjePEzQFre4vbyQ2ip gU4MXT+YWEjuTc+DFW2LzunBdEJpdNvThWTcVHey1ae6Ki1dgiu+/GSGV9mbWvDTCJPs FF0cxa1JN2Zun+SQwlLOmQJkFt/wBWH+zRMOk/ATtYhERoF7Serbdp3Z9giOLkynQxbz X9jphaWLEVMp6/ubEQoonhStJh0GvJp0j3fnpihalM5haV/rsXvLhHblqL/6iaGtnjpD Ez5Q== X-Gm-Message-State: AOAM533ZtmjalcGqisWpeIAu89pNixK3O7ZVdmPlqrzYglrUh8vKR877 xJjkFjK1RrrvRAHdAUf/fwya2ot/iPidfNYv5gVVhg== X-Google-Smtp-Source: ABdhPJxskEt4z+ERhyGQD17DQXn+/I/xUbH/kIs14UdAcFpT7QiQvRSl/uyYzEI6mSU/i59zf8y4l96MGMXa7to9HA8= X-Received: by 2002:a25:d188:0:b0:628:ba86:ee68 with SMTP id i130-20020a25d188000000b00628ba86ee68mr14027361ybg.427.1646783399600; Tue, 08 Mar 2022 15:49:59 -0800 (PST) MIME-Version: 1.0 References: <20220304170215.1868106-1-eric.dumazet@gmail.com> <20220307091541.GD15701@techsingularity.net> In-Reply-To: <20220307091541.GD15701@techsingularity.net> From: Eric Dumazet Date: Tue, 8 Mar 2022 15:49:48 -0800 Message-ID: Subject: Re: [PATCH v2] mm/page_alloc: call check_new_pages() while zone spinlock is not held To: Mel Gorman Cc: Eric Dumazet , Andrew Morton , linux-kernel , linux-mm , Vlastimil Babka , Michal Hocko , Shakeel Butt , Wei Xu , Greg Thelen , Hugh Dickins , David Rientjes Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: A3C184000D X-Stat-Signature: qqwihsuxn5rctqfj9hb3779jasyuxea9 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=V39oqsH8; spf=pass (imf17.hostedemail.com: domain of edumazet@google.com designates 209.85.219.169 as permitted sender) smtp.mailfrom=edumazet@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-HE-Tag: 1646783400-860868 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: On Mon, Mar 7, 2022 at 1:15 AM Mel Gorman wrote: > > On Fri, Mar 04, 2022 at 09:02:15AM -0800, Eric Dumazet wrote: > > From: Eric Dumazet > > > > For high order pages not using pcp, rmqueue() is currently calling > > the costly check_new_pages() while zone spinlock is held, > > and hard irqs masked. > > > > This is not needed, we can release the spinlock sooner to reduce > > zone spinlock contention. > > > > Note that after this patch, we call __mod_zone_freepage_state() > > before deciding to leak the page because it is in bad state. > > > > v2: We need to keep interrupts disabled to call __mod_zone_freepage_state() > > > > Signed-off-by: Eric Dumazet > > Cc: Mel Gorman > > Cc: Vlastimil Babka > > Cc: Michal Hocko > > Cc: Shakeel Butt > > Cc: Wei Xu > > Cc: Greg Thelen > > Cc: Hugh Dickins > > Cc: David Rientjes > > Ok, this is only more expensive in the event pages on the free list have > been corrupted whch is already very unlikely so thanks! > > Acked-by: Mel Gorman > One remaining question is: After your patch ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists"), do we want to change check_pcp_refill()/check_new_pcp() to check all pages, and not only the head ? Or was it a conscious choice of yours ? (I presume part of the performance gains came from not having to bring ~7 cache lines per 32KB chunk on x86) Thanks !