Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5341606rwd; Mon, 12 Jun 2023 03:50:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vbcaa9rVFGtq2W6KkFRcx7VoyLhsf4rA8BYjS6yIvCA4rpQp4OGP4+pSdbSIFuyWYjlnO X-Received: by 2002:a05:6a21:3404:b0:105:a24f:cff1 with SMTP id yn4-20020a056a21340400b00105a24fcff1mr9239768pzb.24.1686567050205; Mon, 12 Jun 2023 03:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686567050; cv=none; d=google.com; s=arc-20160816; b=SC+e0cjx210uKhQJr+2wc4lYpHh+y7/U01J8UO+zFAXfjDYJEQq9TOcz+gm+vfHsck hsBLbLqdVLSRMgHzlgoF4SIubd7bhmpZaq15ufZA6LrMKuOAgOsltzlWkDpSzAzsXtOc OjRxo54m5/bJ5gec+z2KtIlTZYvqHRWzTNhnO8cUoujg6HYXpIw9RghNOjKW9mFcfQqy lKqFsA4xcRkGSCMdzZDYcDmVBehOMLwdfzcdDyKp/70SzDkNCYqSNqV6uRLKYE5TSnTp jQv/NP9whAi340RGOFFdU8pE/jzVOyogJVIzwxOPEMWAofEePGtzoBQ1c2TcADIYNJH4 dJ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=Dqx/dOTiUNpv7HB25tV0EBriLdezn58c/nIheim7g30=; b=tnVn8YPE1IJbz5U2LK0RBstuRS9OfgqJUNzOPupmEp9k8Sv1c5T6FZOUWmfQmMPwMg zbBMmjo2IcTwHK7KS1+RTcTgwgVDgwv3x5Rsotq8yAsVf/J+cMm9O9GWClMurvCWL7+u zeRbkiJ0pTdL6UEt0ap+mr/CFIdp4VUmnqO98WIMyohxifRSSSK47v2g48vBiFCKc7Ci ljaDlChSSXigOR8tq6DfCVmaLwDCgWY+f6vi2/OZY5910CTGLDMBGICUTgo7u3GQMNZa IjPZuM5hWkf0eQxze04DriIgahi2/ixRSDJDuAlsm6BzVPmLGQ0AZMpEusjytDMQoN/Z hMkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HdBasNIG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h124-20020a636c82000000b0053592069d66si6887995pgc.467.2023.06.12.03.50.34; Mon, 12 Jun 2023 03:50:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HdBasNIG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233204AbjFLKnw (ORCPT + 99 others); Mon, 12 Jun 2023 06:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234902AbjFLKn3 (ORCPT ); Mon, 12 Jun 2023 06:43:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBE64EF5 for ; Mon, 12 Jun 2023 03:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686565626; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dqx/dOTiUNpv7HB25tV0EBriLdezn58c/nIheim7g30=; b=HdBasNIG4B2vEwvM21hr8GYlsMUuIc8hF/ZpkfpnAjraEVvYMyJbEdbRfoOqxPtmDzv2jf zeMqmZTXBhtyo2a6ghyCvdjn7l+G7R+mK6Wzbrb25VgVv/nyw6AnD8xiWsPU1r7sWmHo+Q uVApoN2ocx189F5drhldNQXcNG2YyIk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-148-htRKrI7AP-q_gW1uT6qMKw-1; Mon, 12 Jun 2023 06:01:24 -0400 X-MC-Unique: htRKrI7AP-q_gW1uT6qMKw-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f7e8c24a92so15440505e9.0 for ; Mon, 12 Jun 2023 03:01:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686564083; x=1689156083; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Dqx/dOTiUNpv7HB25tV0EBriLdezn58c/nIheim7g30=; b=e7NxwYNgW3kXfUIF+KAydZ6OFrPyzqL/mI/TvfcmxVpM8cYDy11a/bfslay8T0n+cm h9p6lenm4TSp8Yd2nhAKHOIQnbMOBm5HDkZBebX/sNOIL6axOU72dA+mn/0McwqVYGGu McH7Gz1DJ5za8DZ7HWiLAqIHEW2T8j08xOaxV28D0YmUNTRVO13mhG4GvJxLRXOp6TgG gP3EQ7lEfzt5gzTGqsB3pHaMWjRSzdbLyb1LColp6n629ld6x0nlRu1DLNQx7v1zcXMH iVjtvLJ/uu70U3DpUkSNEGQzloY7YfYmNNW7h9wtguGhCzpZoVXTCFWlEQUe1h2RV50e Qyzw== X-Gm-Message-State: AC+VfDw6Fnnjj0uY4t9j9IbrMItr4NjcwO8F2P/HuWnkPhWQtOYLoFn/ 6phbrtGHI4Is5u89b905Co/zsGLmo1hk36CZDvc4G/gPXLpiuViF8VBwirppxVdP9Cg3SS3+akV hMPvQXp5W/ngLwYQrG/CPy4V9 X-Received: by 2002:a1c:7203:0:b0:3f6:58ad:ed85 with SMTP id n3-20020a1c7203000000b003f658aded85mr5769396wmc.10.1686564082909; Mon, 12 Jun 2023 03:01:22 -0700 (PDT) X-Received: by 2002:a1c:7203:0:b0:3f6:58ad:ed85 with SMTP id n3-20020a1c7203000000b003f658aded85mr5769375wmc.10.1686564082545; Mon, 12 Jun 2023 03:01:22 -0700 (PDT) Received: from ?IPV6:2003:cb:c74e:1600:4f67:25b2:3e8c:2a4e? (p200300cbc74e16004f6725b23e8c2a4e.dip0.t-ipconnect.de. [2003:cb:c74e:1600:4f67:25b2:3e8c:2a4e]) by smtp.gmail.com with ESMTPSA id n16-20020adfe350000000b0030e5b1fffc3sm12031233wrj.9.2023.06.12.03.01.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 03:01:21 -0700 (PDT) Message-ID: Date: Mon, 12 Jun 2023 12:01:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCHv5] mm: skip CMA pages when they are not available Content-Language: en-US To: Zhaoyang Huang Cc: Andrew Morton , "zhaoyang.huang" , Matthew Wilcox , Suren Baghdasaryan , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com References: <1685501461-19290-1-git-send-email-zhaoyang.huang@unisoc.com> <20230609153519.ff01046ef0faff00a74bd5b0@linux-foundation.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 12.06.23 11:35, Zhaoyang Huang wrote: > On Mon, Jun 12, 2023 at 5:29 PM David Hildenbrand wrote: >> >> On 10.06.23 00:35, Andrew Morton wrote: >>> On Wed, 31 May 2023 10:51:01 +0800 "zhaoyang.huang" wrote: >>> >>>> From: Zhaoyang Huang >>>> >>>> This patch fixes unproductive reclaiming of CMA pages by skipping them when they >>>> are not available for current context. It is arise from bellowing OOM issue, which >>>> caused by large proportion of MIGRATE_CMA pages among free pages. >>>> >>>> [ 36.172486] [03-19 10:05:52.172] ActivityManager: page allocation failure: order:0, mode:0xc00(GFP_NOIO), nodemask=(null),cpuset=foreground,mems_allowed=0 >>>> [ 36.189447] [03-19 10:05:52.189] DMA32: 0*4kB 447*8kB (C) 217*16kB (C) 124*32kB (C) 136*64kB (C) 70*128kB (C) 22*256kB (C) 3*512kB (C) 0*1024kB 0*2048kB 0*4096kB = 35848kB >>>> [ 36.193125] [03-19 10:05:52.193] Normal: 231*4kB (UMEH) 49*8kB (MEH) 14*16kB (H) 13*32kB (H) 8*64kB (H) 2*128kB (H) 0*256kB 1*512kB (H) 0*1024kB 0*2048kB 0*4096kB = 3236kB >>>> ... >>>> [ 36.234447] [03-19 10:05:52.234] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC) >>>> [ 36.234455] [03-19 10:05:52.234] cache: ext4_io_end, object size: 64, buffer size: 64, default order: 0, min order: 0 >>>> [ 36.234459] [03-19 10:05:52.234] node 0: slabs: 53,objs: 3392, free: 0 >>>> >>> >>> We saw plenty of feedback for earlier versions, but now silence. Does >>> this mean we're all OK with v5? >> >> The logic kind-of makes sense to me (but the kswapd special-casing >> already shows that it might be a bit fragile for future use), but I did >> not yet figure out if this actually fixes something or is a pure >> performance improvement. >> >> As we phrased it in the comment "It is waste of effort", but in the >> patch description "This patch fixes unproductive reclaiming" + a scary >> dmesg. >> >> Am I correct that this is a pure performance optimization (and the issue >> revealed itself in that OOM report), or does this actually *fix* something? >> >> If it's a performance improvement, it would be good to show that it is >> an actual improvement worth the churn ... > Sorry for the confusion. As for the OOM issue, the previous > commit(https://lkml.kernel.org/r/1683782550-25799-1-git-send-email-zhaoyang.huang@unisoc.com) > helps to decrease the fail rate from 12/20 to 2/20, which it turn to > be 0 when applying this patch. Thanks! Can we make that clearer in the patch description? I'm struggling a bit my self to find the right words. Something like "This change further decreases the chance for wrong OOMs in the presence of a lot of CMA memory." ? In any case Acked-by: David Hildenbrand -- Cheers, David / dhildenb