Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8930901rwb; Tue, 13 Dec 2022 12:22:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Yulho4vc0Bh+9WThEGzmmyCJxlqWv4opfvPxaUED/SDdBj/suEq8qzH1FrbEcHZIpYpHv X-Received: by 2002:a17:906:7243:b0:78d:f455:b609 with SMTP id n3-20020a170906724300b0078df455b609mr17187324ejk.73.1670962939023; Tue, 13 Dec 2022 12:22:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670962939; cv=none; d=google.com; s=arc-20160816; b=ljPJO4tsuLSJ+UYA0hG2UNYQrVj7lzzZaqrT5g/wZ6agPn2rm5chWtC/kCBGsqFB81 G3KY4qsaPfWNjlsRsuiWeL4emP1Hk7e7yMgFPNXMF4GchsE8cy3ADCX7Jtkdw3/ZxqhU zPNIVqMB4wJxJ1vStjkb4oVOX2AmjX19B1pl24YwG1OHcrmdl3naOFCfdMGgg/edJy8y ru2SYJ3JAnHYwey+9r2Wq2CDUtDwvCGAlrsmbEH8z2iHJNtFjPPFVbdBB7QYpoM2Wxb0 wzCUTN3cW8pkCc1/Xii2v8JxNL0ubNKYul4Yu+MD8GAJN29v4QSIKNOfyOUjSpZtZm8H oYsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gPrNwp+vaK5qq19ki7abmk2sg7tKc5TszO1p3lOT9Yk=; b=U37kXJHE+SZt/Moetyrm8BW0n7u32vbGzWr1vPB+R6fsIggwT1smgoiBxlG+lu6ffR qQTXtlSqCzpCqpKrk1gdlSzbIiJzL3veYV86z0e0SP1aoCFYUMA7ZtOTvcev2nro5Gms RjjrDcsS4o5yN8vIsdGM6CN720yoOut5//zRftCJhx1CwxC/eEMvVGvxdmZrspKL2Obo oKSxczguWKQ6ePy2sgEfP7zoai2oEBX5dSM0HnvhyYFvCXYGKavpDioVCxH/6dxzYday JdNYELE+sx7+CP/Ai7rTzWEu5U8U4SA6lIkHe6aLM1a0WFkmQbwMM8K8sNkyKa7qYxrD Ja2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NWAKTsGu; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg33-20020a170907972100b0079b8cce1170si1083215ejc.950.2022.12.13.12.22.02; Tue, 13 Dec 2022 12:22:19 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=NWAKTsGu; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236802AbiLMTTM (ORCPT + 72 others); Tue, 13 Dec 2022 14:19:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236267AbiLMTS5 (ORCPT ); Tue, 13 Dec 2022 14:18:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C111274D for ; Tue, 13 Dec 2022 11:18:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 353BBB815B1 for ; Tue, 13 Dec 2022 19:18:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D6C6C433EF; Tue, 13 Dec 2022 19:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670959133; bh=TnGFtpo/Gv6B9vWS/Wf+h/ZzAKUAJ0Ui+Kiqz4jbn+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NWAKTsGuzWZbpFnlq/Ya+YL1ixTLq31LqywtwQUjkK1tyhWceH4KXHLwdQoa1ss6F JR766RqxBcp3uYEOZjSRggwmyJUciPFnsK7DeH9uCOD2H7y8Pp5a5rGI1f7/9sRwTj btehXRDmlEJZWxCf82CkB1n1OSY0GHxC0an+2zobCA4R81RK97DMM2TrTSBYpqgxry c6eLSdg69Y46jZaoEgP78R44IofwHRJU9CNPIPvR6knuUlAessUYZ9L8zHOByJETQa 2Yins9gTJyEfS+Ml7zQJbCxTI5ism0KQBlPrEaKcTFwZlx8p4OS7sGXYwpIUQ7WAiz g2RxbaBH+etyw== From: SeongJae Park To: Matthew Wilcox Cc: Kefeng Wang , Andrew Morton , David Hildenbrand , Oscar Salvador , SeongJae Park , linux-mm@kvack.org, linux-kernel@vger.kernel.org, damon@lists.linux.dev, vishal.moola@gmail.com Subject: Re: [PATCH -next 4/8] mm: damon: add temporary damon_get_folio() Date: Tue, 13 Dec 2022 19:18:51 +0000 Message-Id: <20221213191851.138660-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Tue, 13 Dec 2022 14:40:41 +0000 Matthew Wilcox wrote: > On Tue, Dec 13, 2022 at 05:27:31PM +0800, Kefeng Wang wrote: > > -struct page *damon_get_page(unsigned long pfn) > > +struct folio *damon_get_folio(unsigned long pfn) > > { > > - struct page *page = pfn_to_online_page(pfn); > > + struct folio *folio = pfn_to_online_folio(pfn); > > > > - if (!page || !PageLRU(page) || !get_page_unless_zero(page)) > > + if (!folio || !folio_test_lru(folio) || !folio_try_get(folio)) > > return NULL; > > Well, this is awkward. I asked Vishal to think about exactly this problem > and we were going to talk about it after we're both back from vacation > in January. But I guess we're going to do this in public instead ... > > Specifically, what should the semantics be for a putative > damon_get_folio() when it encounters a tail page? Should it return > the containing folio, or should it return NULL? And if the semantics > change here to return the containing folio, what adjustments need to > be made to the callers? I'd prefer to simply keep the original behavior, returning NULL, for now unless someone complaints. Thanks, SJ