[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250617134251.GA1376515@ziepe.ca>
Date: Tue, 17 Jun 2025 10:42:51 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: lizhe.67@...edance.com
Cc: alex.williamson@...hat.com, akpm@...ux-foundation.org, david@...hat.com,
peterx@...hat.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v4 2/3] gup: introduce unpin_user_folio_dirty_locked()
On Tue, Jun 17, 2025 at 12:18:20PM +0800, lizhe.67@...edance.com wrote:
> @@ -360,12 +360,7 @@ void unpin_user_page_range_dirty_lock(struct page *page, unsigned long npages,
>
> for (i = 0; i < npages; i += nr) {
> folio = gup_folio_range_next(page, npages, i, &nr);
> - if (make_dirty && !folio_test_dirty(folio)) {
> - folio_lock(folio);
> - folio_mark_dirty(folio);
> - folio_unlock(folio);
> - }
> - gup_put_folio(folio, nr, FOLL_PIN);
> + unpin_user_folio_dirty_locked(folio, nr, make_dirty);
> }
I don't think we should call an exported function here - this is a
fast path for rdma and iommfd, I don't want to see it degrade to save
three duplicated lines :\
Make the new function an inline?
Duplicate the lines?
Jason
Powered by blists - more mailing lists