Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3590873pxp; Tue, 8 Mar 2022 18:15:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJypfRGChQgzYjw5cxYM3ECU4ecppt+gBS3Imwl+Xe85Hkmd5sPKDKv3EZsarJA/nUdxiLRT X-Received: by 2002:aa7:909a:0:b0:4e1:6d4:5905 with SMTP id i26-20020aa7909a000000b004e106d45905mr21471367pfa.34.1646792137545; Tue, 08 Mar 2022 18:15:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646792137; cv=none; d=google.com; s=arc-20160816; b=XU4CgMoYpHrOH3xzA4gmhjb5eNEExmhifJ4yVc1XZvBXsmltqa+ZNdRX64Y0vhEEXw mE7QG3D16vf9Xn+s4ND4V/jYPkwwNNHru2PKOULeVPRExUziZhmgCpXirGKnks5fpKRY 2w8DS+KrOxbL2+wR1/bJyROnEmZmtdmMY4pX1eE75gcFTzBQDNY2KynixLUiwRM/bM+y nGNz8bQeJSqPnIObI/rc3golERZLJqDU6ULWPnv0bi5hh1k88mgjIhlMHZlFfKUGGx6A 8Ffk8cEahweawn8QksXBGdEY5rADQUXCTTHnjH+whcTovOfyzOIv/BIBFpbKzSS2GUYD fI4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6blG6EAzX4w/WH2eHf6lZLaVJfDBuoOmPYe51zQt/4A=; b=M9HcqH/5mUhkkdCjjBG9gMIFPNYNPa0+iSsNo6FAwh2nDZtUEfQy+hNy7bjZBvRIVx Ibi+NYu9N6G4TF8Ny5fy5/HM9y6lgJI4EO+KtbQzHB7Mi+0o93085XmKoWDjzRyUyFKL MPedu1MmBduN5L6MQ7UI/1k40zRW7N+k8Hl30ie7xc8B4rFH1ZnhL1/ZDyvdSOgWqX// UiW30zhURdD7pQBhK2+t8iWTMT7zuNXOTAq1ivF5m1pyuXMpqUpklpR4GmYMrAFQzXxs L3PE3TU3ADe/kU3myC4HGTircY64kfLPv2j87r8TZRk8KY7Tb5HtQug9FAFyQXSTWB5j BNlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=V39oqsH8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bj23-20020a056a02019700b003806fb452d8si556983pgb.721.2022.03.08.18.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 18:15:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=V39oqsH8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5651DFD1; Tue, 8 Mar 2022 17:08:20 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbiCIBIR (ORCPT + 99 others); Tue, 8 Mar 2022 20:08:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbiCIBHu (ORCPT ); Tue, 8 Mar 2022 20:07:50 -0500 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C35F13DE2F for ; Tue, 8 Mar 2022 16:48:11 -0800 (PST) Received: by mail-yb1-xb30.google.com with SMTP id x200so1184631ybe.6 for ; Tue, 08 Mar 2022 16:48:11 -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=N8dqYi15iraRzn3Ycgc7myVMRV0cgTHR/GS2aFH9+d3Wi3HA/JY7p0Kc8QTtnRUkul U4oGmbMbcuAhbYGWt2/6sWbaQ/Ry2REV9Jp2ZsRwxDXCwm0Vb3NJv4zbfZlYPkZDrpmv 65xshr2DayaARjKTdmePR2e68/l/dqfSKmCXBniEDgtzg6BeHREJI84ATYb4xyC3bQ7k xhjuB8coJqRkrQS3qsJKU7Nq9UfMpJVV2Wnv8K+fQ/AH6B4r5RIzoE2q4ruXFpIfaPV2 wBzdki7v1tQ8AjLuxZkFzd0ZlPnS1O+xdP0utnsMaYU81KXhOBYu+6/hIXFL1+GFOGrE kEjw== X-Gm-Message-State: AOAM532h3Ytg1lxfZ61LGL0FVtsC3tHr/+SqtQYjpDVECQWULYSlbLtu suS2cFbUr/1/W0jyQtWYIYfB7hwptIf6CnMiXukSVE+PmB2OThmD 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-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 !