Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp767170pxb; Tue, 12 Apr 2022 12:56:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHdEX+x7VufZbBoRRmKXq5Yaj1NCchb2XqJ5PVFEhjy7l8MCLbOzt2iItt0GPgE1tcLaUp X-Received: by 2002:a17:90b:4a83:b0:1c6:f037:bc73 with SMTP id lp3-20020a17090b4a8300b001c6f037bc73mr6792965pjb.44.1649793375998; Tue, 12 Apr 2022 12:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649793375; cv=none; d=google.com; s=arc-20160816; b=AQ/uv8zc6INANW3oMtZubjCssRGoauOaqQgz4AP6gr+zgEz52cMcr01ihRXiQTrISJ wksfxZoIPtH4W1YButUoZSp2ZnyWEhlW6EHAWAq27vwuWHFfKY+kk1bQNz6fHYzyegHV nYKdFP6MAxtRUdqRm6WKt+NXdaOZvdd7iaB2mcjsfRJWU8xcRwMwlh54ZeQ8N49VtGd0 6D8mmWr6OGh5TqyO63CpKoBkgTwQsAWQSHGxgtFlXhL/J/I22kMP+GSJWWaqB10tZCqN mBLcZ/8rGbqrcHRLEe5AsZpqw6Lcl6zDyLUsC7xbiDiVsYF8qq7FZdCaVq+te7c6TeXs juUw== 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=+RMao/icjZOR7b/VhfyeZ5DmNqqniWO1wzUexEJFUx4=; b=DRHL2Lpz4W0D6co6PgMIt7ta35cYJOC8kayxSTDH/cwoELodaNlYeX54GvlGgxspbC 9U8NitvNsQdSue2WVjKNamfRLjE/mBq20IXCmU/UPtcNGRN5tqqrG996ZN0G/5nuuNy5 PvQDOvui7ZEMaN4/tR91gBOnr4p0QD40UP4czxrr+G/VwWttXCAInw/qSBgsHdhOb2dD e8kAWS8laAspEmTbH5ZmRXc/BXMOhZ0D3Cdf86Z+vRD+jNeqgYEpnrDQqSxvd7Gn2SFp 30LaUNf930SWNYjk1nsunCDadmVwK/s8jWAK82AA1I6vX1pccqC7vb7YTaoGDHKE56yU ykOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S4wSXCm0; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 21-20020a170902c15500b001583459615esi10126815plj.86.2022.04.12.12.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:56:15 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=S4wSXCm0; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F2FD2FE52; Tue, 12 Apr 2022 12:49:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353302AbiDLPB4 (ORCPT + 99 others); Tue, 12 Apr 2022 11:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242923AbiDLPBy (ORCPT ); Tue, 12 Apr 2022 11:01:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9A8EC4D63A for ; Tue, 12 Apr 2022 07:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649775575; 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=+RMao/icjZOR7b/VhfyeZ5DmNqqniWO1wzUexEJFUx4=; b=S4wSXCm0SR7AjQ9MIFwGdJ9ko96+zYmLN2/mHS6CTvl0t+WPHvC/Siat34vSbkLDzRni7D 6/egsv+jgS93LBFmY4xL2JDVFCWeBwUWKbKHZThkBxoDGqItLN6ip7nq08nHPcVmN/RleJ iBfBZLf9fPoOl0umCEnEa+E6vMOy6aM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-394-iUNEU0ziNruloCAoZ778BQ-1; Tue, 12 Apr 2022 10:59:34 -0400 X-MC-Unique: iUNEU0ziNruloCAoZ778BQ-1 Received: by mail-wr1-f70.google.com with SMTP id j67-20020adf9149000000b00203e6b7d151so4106293wrj.13 for ; Tue, 12 Apr 2022 07:59:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=+RMao/icjZOR7b/VhfyeZ5DmNqqniWO1wzUexEJFUx4=; b=srK5KMeIs2i3pMD4e7dAJSwobEPnc3785JyAI8dQelZa2O+VqzD+M8IyKDbY3+3qGP iyoTlRcumUTfjIDIQqnLQipDIEtaayurW2a9djkkfTAhdGOSCixEiqOkTSAkcG22bKPh wrDBnKdMfbUII87H6bGO6ugXIsaq4uIf4gP8f9I2kqJ0rpOdKyeQ1giUppkpwf8bNOTI v+DImyEJK2qh3JX/Jl+g5Vu5mnLnqC3d4Xi6mC3964IDvP3/9dbC8KiTOx4GKXtC6FQw mTvgiMf6GyS47FxX3GDSGCkX9YCd2QJA4BwqDhaHSGiAiOIcrFl/fgF6q2Hps9idZp4j teFg== X-Gm-Message-State: AOAM533tLU8JsB3501XUHhMJOUNCxnm2lgsMbD+FGli25i/O0ta30RMP 5qBV91nppUcDSPeWDc70wKyfWayN7pmKgb1bw3OD9aU/NylKpT+0ViMirKBtwjUKA+4G+WL6pRw RIU5r5oIH7uml2W+gLduqcWw9 X-Received: by 2002:adf:ed8f:0:b0:207:ac33:801f with SMTP id c15-20020adfed8f000000b00207ac33801fmr4562910wro.453.1649775573381; Tue, 12 Apr 2022 07:59:33 -0700 (PDT) X-Received: by 2002:adf:ed8f:0:b0:207:ac33:801f with SMTP id c15-20020adfed8f000000b00207ac33801fmr4562895wro.453.1649775573157; Tue, 12 Apr 2022 07:59:33 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:1800:7c14:16cc:5291:a9f3? (p200300cbc70718007c1416cc5291a9f3.dip0.t-ipconnect.de. [2003:cb:c707:1800:7c14:16cc:5291:a9f3]) by smtp.gmail.com with ESMTPSA id b14-20020a7bc24e000000b003899c8053e1sm2742525wmj.41.2022.04.12.07.59.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Apr 2022 07:59:32 -0700 (PDT) Message-ID: Date: Tue, 12 Apr 2022 16:59:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v2 2/9] mm/vmscan: remove unneeded can_split_huge_page check Content-Language: en-US To: Miaohe Lin , Oscar Salvador Cc: akpm@linux-foundation.org, ying.huang@intel.com, songmuchun@bytedance.com, hch@infradead.org, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220409093500.10329-1-linmiaohe@huawei.com> <20220409093500.10329-3-linmiaohe@huawei.com> <7455b680-3d89-5d3e-ba0e-6e4358b114a2@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <7455b680-3d89-5d3e-ba0e-6e4358b114a2@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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.04.22 15:42, Miaohe Lin wrote: > On 2022/4/12 16:59, Oscar Salvador wrote: >> On Sat, Apr 09, 2022 at 05:34:53PM +0800, Miaohe Lin wrote: >>> We don't need to check can_split_folio() because folio_maybe_dma_pinned() >>> is checked before. It will avoid the long term pinned pages to be swapped >>> out. And we can live with short term pinned pages. Without can_split_folio >>> checking we can simplify the code. Also activate_locked can be changed to >>> keep_locked as it's just short term pinning. >> >> What do you mean by "we can live with short term pinned pages"? >> Does it mean that it was not pinned when we check >> folio_maybe_dma_pinned() but now it is? >> >> To me it looks like the pinning is fluctuating and we rely on >> split_folio_to_list() to see whether we succeed or not, and if not >> we give it another spin in the next round? > > Yes. Short term pinned pages is relative to long term pinned pages and these pages won't be > pinned for a noticeable time. So it's expected to split the folio successfully in the next > round as the pinning is really fluctuating. Or am I miss something? > Just so we're on the same page. folio_maybe_dma_pinned() only capture FOLL_PIN, but not FOLL_GET. You can have long-term FOLL_GET right now via vmsplice(). can_split_folio() is more precise then folio_maybe_dma_pinned(), but both are racy as long as the page is still mapped. -- Thanks, David / dhildenb