Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4736351rdb; Fri, 15 Sep 2023 10:38:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1cfh5OGk17bz6EzB3yxunie43Lk2HKwmrpHm5c0xViYaLul2GmFQP38LxaAod6k0Wg7n1 X-Received: by 2002:a05:6a00:1250:b0:68c:69c8:e0f0 with SMTP id u16-20020a056a00125000b0068c69c8e0f0mr2555112pfi.18.1694799524569; Fri, 15 Sep 2023 10:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694799524; cv=none; d=google.com; s=arc-20160816; b=EREpej+/NoxMHwsyLo8uas1G5/0StNLhz3VbFM4SqSaaRdfAus9alPKv/GGkb0iVEt ohCYbCC0sYIh+tEZ+gYXRIvH4yZ7tMETjCUsqu9zMfS2gVlmnJ5CR2njGgWaZ54PM0FS wqZx1wzVk5fqM0bREtmyP6JTQyFD9WMDNgS+SbycOsCFXEK0sml2qYmiWP/o/mKESINQ 9k5jCUu+gZOQjUuIbPeEPyiPn226RMowQKf4e4TGCHVz85L/FI9CGlotJkj83xefi4lV TN0d2TrZfG3pBGjrCrI3iphsaGjgXpfmS3g5ar1vmVNV3Oo4YuYv3bYlRxHEmK1dctVR ci/g== 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=QKvZfNUAeqRJOa+1glQDGtoNRuRm5yfurVcRjFqOx34=; fh=oJ6m8Z5i/YHc2CXV8cVoJijg/pE1w44ryutGN0Otbk0=; b=SU9IFux9TQ0EBSvONkdueL8pblo5B6OJr6QkzJz3eHL1PN/J+PhGIyQ42oMerteYdq WgK5eGn8H3uTamhrgS48LqAPFj6wiDC4JXu0ilQiEl7uV01PgxAoRf3FqJPcmZxX6qNd 4DF4EJPV1uyXWPNM8vqiZYppwgFD2zQCn6R5ecwN0FM9ozoOVRVUE5i9gfEVLwzuFkIM vpf2mrQO+d8m0UG8oGG2KA5+GycnNeDQvB5PyljQLnWak3kxF1ULBh5ca9AaE7hVxvUO /+AOLU2nExt2DRFIqXe2OO6iCEsYvsfzjmfiLBLqpm0het3itNbz568UxiGSbez7Fn64 eYvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jJzYRDYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q22-20020a056a00151600b0068fba0fa267si3767446pfu.369.2023.09.15.10.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:38:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jJzYRDYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1E905841025A; Fri, 15 Sep 2023 08:38:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236145AbjIOPht (ORCPT + 99 others); Fri, 15 Sep 2023 11:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236140AbjIOPhY (ORCPT ); Fri, 15 Sep 2023 11:37:24 -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 1E1A5E6D for ; Fri, 15 Sep 2023 08:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694792193; 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=QKvZfNUAeqRJOa+1glQDGtoNRuRm5yfurVcRjFqOx34=; b=jJzYRDYIqGicnPRec/BjS4lBa6MVl4Scas4TIAdnTvB/Q3ktGlcMrtgkctyO7vmtAtl6Ak RgXJ3MwAJ0wYFYW5Bn4wQDQO39NdBHp69sOYNNoEs3raVQww2nuvohffOnOVbYzv72TgCr 1D8TZkRu4LjIwo5Cu7lFzfYzL3laP8M= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-MFuklsKtMV6dVM-kAyi7YA-1; Fri, 15 Sep 2023 11:36:30 -0400 X-MC-Unique: MFuklsKtMV6dVM-kAyi7YA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-31fb896a87aso1565141f8f.1 for ; Fri, 15 Sep 2023 08:36:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694792189; x=1695396989; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QKvZfNUAeqRJOa+1glQDGtoNRuRm5yfurVcRjFqOx34=; b=lWnwdNJzuE4DK9JuKtN6tXUopbg/zochkofiAuAKPkm3V8YQfAbMCR2DJ36aY5/2Z7 GzmwHIivUPSR2P1ujn9fGLEztEanNdUnWPOv5okCUx9MqvRZxbOUnoFUt29Rb5nc6M1X FFRJZ8ZX+a8M5OWeBetbT9WgexVmF+VoH30GvklAg46kKHuAoOUQDM9cE70wx+cNB5yW w79/dzDPtM872VvD89KEoZrF/UqcTDaCvM5XBpSyHLpsavscQP+Ft7fFBT8fTkoJCysk rv5AXM//0SZzXc6KY9a4b7OR+Lg+r9gfYNsQ113/W2JJUboEFVqgGIxrujoyWbQOZ9e1 couA== X-Gm-Message-State: AOJu0YwQC7krNt3xZ7Cc6qEWJiSqAfedAKniH5YUz9GSedlUyDamuQ7f VazAzPIdyYd6Q72UPWUHejmLmZmflUN+cTMY7hqltCdTkfbOhQKR+ii8FoTpy7uJeiUVGM3+YjV spWgxjKj6Sd3+DrJk25xR9FsBpkmh39WY X-Received: by 2002:a5d:46cf:0:b0:317:ec04:ee0c with SMTP id g15-20020a5d46cf000000b00317ec04ee0cmr1704601wrs.47.1694792189683; Fri, 15 Sep 2023 08:36:29 -0700 (PDT) X-Received: by 2002:a5d:46cf:0:b0:317:ec04:ee0c with SMTP id g15-20020a5d46cf000000b00317ec04ee0cmr1704581wrs.47.1694792189303; Fri, 15 Sep 2023 08:36:29 -0700 (PDT) Received: from ?IPV6:2003:cb:c728:e000:a4bd:1c35:a64e:5c70? (p200300cbc728e000a4bd1c35a64e5c70.dip0.t-ipconnect.de. [2003:cb:c728:e000:a4bd:1c35:a64e:5c70]) by smtp.gmail.com with ESMTPSA id y14-20020a5d4ace000000b003176eab8868sm4793784wrs.82.2023.09.15.08.36.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Sep 2023 08:36:28 -0700 (PDT) Message-ID: Date: Fri, 15 Sep 2023 17:36:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 0/6] shmem: high order folios support in write path Content-Language: en-US To: Matthew Wilcox Cc: Daniel Gomez , "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "gost.dev@samsung.com" , Pankaj Raghav References: <20230915095042.1320180-1-da.gomez@samsung.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 15 Sep 2023 08:38:22 -0700 (PDT) On 15.09.23 17:34, Matthew Wilcox wrote: > On Fri, Sep 15, 2023 at 05:29:51PM +0200, David Hildenbrand wrote: >> On 15.09.23 11:51, Daniel Gomez wrote: >>> This series add support for high order folios in shmem write >>> path. >>> There are at least 2 cases/topics to handle that I'd appreciate >>> feedback. >>> 1. With the new strategy, you might end up with a folio order matching >>> HPAGE_PMD_ORDER. However, we won't respect the 'huge' flag anymore if >>> THP is enabled. >>> 2. When the above (1.) occurs, the code skips the huge path, so >>> xa_find with hindex is skipped. >> >> Similar to large anon folios (but different to large non-shmem folios in the >> pagecache), this can result in memory waste. > > No, it can't. This patchset triggers only on write, not on read or page > fault, and it's conservative, so it will only allocate folios which are > entirely covered by the write. IOW this is memory we must allocate in > order to satisfy the write; we're just allocating it in larger chunks > when we can. Oh, good! I was assuming you would eventually over-allocate on the write path. -- Cheers, David / dhildenb