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 14B68C433EF for ; Tue, 12 Apr 2022 14:59:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B2A36B0071; Tue, 12 Apr 2022 10:59:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 461F36B0073; Tue, 12 Apr 2022 10:59:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3297E6B0074; Tue, 12 Apr 2022 10:59:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id 24C5B6B0071 for ; Tue, 12 Apr 2022 10:59:37 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C992CAA163 for ; Tue, 12 Apr 2022 14:59:36 +0000 (UTC) X-FDA: 79348535952.30.466E402 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 100678000F for ; Tue, 12 Apr 2022 14:59:35 +0000 (UTC) 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-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-Bdeu4NaKNvyaNeo0w-vLIg-1; Tue, 12 Apr 2022 10:59:34 -0400 X-MC-Unique: Bdeu4NaKNvyaNeo0w-vLIg-1 Received: by mail-wm1-f72.google.com with SMTP id h18-20020a05600c351200b0038e82e6321bso6052466wmq.5 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=W/Gt9pEh2UG5pfcihffU+iCQaDeT7yi/eOkDbMqlRbuUh2ATSak/9VK5M6ORtIPkhS 0usXfqLdJsqsmdGU+abkB/I+HVKPLbOCaMdimhb03EKdQFRWbe68wyLfS7y1J1dqwJcl bHWy0w0xOxc/4LkmoOVYfrG91JW8UWRCvD49qeZVTgWoTYwQu//viaH0SJrAfByHRvOG P2FQ1L8Wik13C4IUjT99amTHOTYyty/dYqmgkdcYXcjU5c9hk9/MGoU9y1qdB5ICZRmA cBoIHYwRMlOYS3l9KLxuNvyQPskGtNyhvRaYD1/azJzZd0aJ5Sb9mV4E4Ob3b7th+DN+ b05A== X-Gm-Message-State: AOAM533tPOoB0EgjFE2wKe4YIQtiyb8hpWjFFcr8dTEieG6BXrLkgiss dx0q+PHIXu+NKr6MFV2fIbvG1LihN2MSivFfKF7rYVAdXn1nSIBxFEYEuMGhd7TjOQ9Z67ic+LF 90otUERxCykA= X-Received: by 2002:adf:ed8f:0:b0:207:ac33:801f with SMTP id c15-20020adfed8f000000b00207ac33801fmr4562920wro.453.1649775573400; Tue, 12 Apr 2022 07:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLIpWvCj37SohK2EXJPy09eJg+fXmpEUsKlr6HFfmxumMiwnsh1WJNnv09XjQ/431Bs8Hs9A== 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 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> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: jukfjmpwtzfh4sobuiumw368igkn69j7 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S4wSXCm0; spf=none (imf02.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 100678000F X-HE-Tag: 1649775575-76085 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 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