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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B29C49EA7 for ; Fri, 25 Jun 2021 01:57:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BE1F608FE for ; Fri, 25 Jun 2021 01:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233029AbhFYCAF (ORCPT ); Thu, 24 Jun 2021 22:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232917AbhFYCAE (ORCPT ); Thu, 24 Jun 2021 22:00:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FB2C061574; Thu, 24 Jun 2021 18:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MXjKTNHOnjltT/dot/g0YTpYEVLMdUkJzO1LZTVDP6o=; b=JZhNvXWvrjI4O4uDc3UFXGdV6+ 6qiO/mBCCwvyi9o5MzFKjhi271ph7C+nds62urru+bHOUPNaTv/1PJQpTjSwbKNkP0qPttjibrZI6 lEVx1xji8mb51FWW0rLvgp8CdyYSQo0ghjYDuqcB+MXq9KY8DAZdYrZdXecj7qnVlWolkM5iZfcmO MhfpnOFM+47D67scmXfYV8tv2z97pEM6u19Ii1MtmufPshdMkSxUrAVx2ziAlhZjiv7quQO5KGgn5 QS2X50QIHG0cQ5lSJ8ogV8/0xcLgL+6CPww/br5vmRUZ9xzpYl4JsYD6sLvyTnrUR1Cwj19bb70eH 2CpZoB2g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwb5s-00HDJz-Cr; Fri, 25 Jun 2021 01:57:22 +0000 Date: Fri, 25 Jun 2021 02:57:20 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 43/46] mm/filemap: Add filemap_add_folio Message-ID: References: <20210622121551.3398730-1-willy@infradead.org> <20210622121551.3398730-44-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 23, 2021 at 01:30:04PM +0200, Christoph Hellwig wrote: > On Tue, Jun 22, 2021 at 01:15:48PM +0100, Matthew Wilcox (Oracle) wrote: > > Pages being added to the page cache should already be folios, so > > just cast the page to a folio in the add_to_page_cache_lru() wrapper. > > Saves 96 bytes of text. > > modulo the casting: ok. Moved add_to_page_cache_lru() into folio-compat.c, added the call to page_folio() and also added: if (!huge) { + VM_BUG_ON_FOLIO(index & (folio_nr_pages(folio) - 1), folio); error = folio_charge_cgroup(folio, current->mm, gfp); as we don't want pages added at an unaligned index in the file. > Reviewed-by: Christoph Hellwig