From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB2ED1D63E4 for ; Sat, 4 Apr 2026 01:43:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775267038; cv=none; b=hHz/e3mDHyaHydCg7PIUaA8luCnkWKe017ljo8x89ascCKckwWnL8KbsKkwEhFB2OImc6p/gf+hbWLDO3oDnj7FQUNsAoKPgSMBaGt6xxAYMxLMem4By2OFyxTVzgC6qjMcAvg2voAlsYAevNw/lqSFfzPTc1lmn9Un3NqKmEPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775267038; c=relaxed/simple; bh=o+mXn+mO3TOBOhs6Vj4ImptTHtx9x7UXnCndYtnzSCE=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References; b=mHciysPF8Os9ARDNja8B1kJJPNsy6sEWnbXqKrsAxPRyUf+a/F+sUYHGPEf+pNiFlICWL1npPyO+xAIALFJjcOeUw06sItBM47BtncC4L/n2WZpIAbZGh7y3bqbxM3Y7dS98wI6UpETCyDedGTglE8DY6NHg8SqnfMslNkOYI8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nXr3C9g2; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nXr3C9g2" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-35691a231a7so1287684a91.3 for ; Fri, 03 Apr 2026 18:43:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775267037; x=1775871837; darn=vger.kernel.org; h=references:message-id:date:in-reply-to:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=mSmUlQx+7wcM8hvk6KgWAN6mYWx05Ua8pH5lZ6mYZjw=; b=nXr3C9g2rOFq3lOWtfJXdm1R3NpHTu0T5mbjoqhvOlZ9h18+ISrPrL4zOUB/n+NNrB SHEf23xnLEPX/yTwckXO60RlK5cx6bJLu4CLZpJ6GRhUnAxc/ARpRIN/ziZy4zLNrCEq PCptii73YhlofADub/f6Z7mOeowVBjS+LTCtxtGz3wN+g06GowochDaJUc8f5zh5mQOG fjydkerhn2of1EDtc9N2L+ThYnMV4qQxlC7UvyjzTDE7lwNh5Xis44qUOW9+i/MyDdRm IV+BXh6LNwwnHlFIGbXi8u0atoU76iTmq8pLH/Vd/9uhYE51qLVGibdJ41EWk3AlGhKv dFKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775267037; x=1775871837; h=references:message-id:date:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mSmUlQx+7wcM8hvk6KgWAN6mYWx05Ua8pH5lZ6mYZjw=; b=qhfy1GRT1XA2vxoTZzoIlTRYX3Gyj7AdoG1Vv0VXvoL2dbKyu2/tlXrTcjJMbdPn+K 6ESASbXBxtAM3zx6OGdu/qCNUmIpPXBViXwHNmqU4CcE3wy6aCEuPxPAYPC4S/XJn3D4 fvh/p82YuT1xkjZzm41gIfh/CBIJcI08A4mcgFIGAM3pES+rgmANw5vULLIdIKKeK/Rm 6fNbQ7rjHXf/n0f46zLpkTCmkXtIVbUZvOrZ38ayyl1b4H5yLVX5vHKUSgwdmMBgAHrE WVje+o4k2OXayfwD7uUbuTL+hj3OVXdY2WW1z47NGvZdvK8PCOoaX+NoYrbfQF3hCtTr Xj0w== X-Forwarded-Encrypted: i=1; AJvYcCWAT0owYtuIJ1HgB6UvG5raQiS0u9TP06aH4v+NCTfGd0+UwHkEoy97DUlbFE6yFC/grPnc0zcwirg9Fm4=@vger.kernel.org X-Gm-Message-State: AOJu0YwQOAm/VEI2JDw8+2RdWLUdW2qRhCkiSQ5iOuXLZuTVx0VtAHC9 Q2lWtVlUfghJsxuefFKxgYxe9M1D6qhhiI5CZVGRZmv78KWr6cYTl1Oz X-Gm-Gg: AeBDieuwHyja2nOe7ZbMdvyk2sGFPQrxh44DNqE+kCap04y34FDQ9dKASXjK2tUNFFb 4Uqzck5sLOr1TvLFGtletltkzD1xmGC6e0LPsjr7oSTXk8guL4QC1ZvKbKIeg0/o5Qg5wglSTYi m97qsCEMzHRN61LCKKb9G12d6yi7++AlOctfNO+5tM5aFlElnigKuunVlBfSr/44BH2c030ypCq yO97Rnnl2Cm3NyKHINawtTkUN5tgtAlehEx8g8+IqcGmJqu82x0EWAZQawYTjR/XrAKJ3erKQ9+ h4YCTMK/r5FIWQJ1SqCIgsEfi6UJa66hyYL7wiAuSH2252PBkH6tQ24idtFXD6JXuKhtbXdPiI1 anxiOfJAPvzrmAUo2Y6nucY439gd5DOQDZDufKfTaOxSLir9UTKyn+J98D5zgC+KRs1cc5t6IM1 TUdXjW5Z2Wp4IeBk257H7YY2bBsbp+ZIMQ X-Received: by 2002:a17:903:1ae3:b0:2b0:afad:7aad with SMTP id d9443c01a7336-2b2818016c3mr52841215ad.45.1775267036795; Fri, 03 Apr 2026 18:43:56 -0700 (PDT) Received: from pve-server ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b2749cbca2sm65157255ad.73.2026.04.03.18.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 18:43:56 -0700 (PDT) From: Ritesh Harjani (IBM) To: Salvatore Dipietro , linux-kernel@vger.kernel.org Cc: dipiets@amazon.it, alisaidi@amazon.com, blakgeof@amazon.com, abuehaze@amazon.de, dipietro.salvatore@gmail.com, willy@infradead.org, stable@vger.kernel.org, Christian Brauner , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/1] iomap: avoid compaction for costly folio order allocation In-Reply-To: <20260403193535.9970-2-dipiets@amazon.it> Date: Sat, 04 Apr 2026 06:43:06 +0530 Message-ID: References: <20260403193535.9970-1-dipiets@amazon.it> <20260403193535.9970-2-dipiets@amazon.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Let's cc: linux-mm too. Salvatore Dipietro writes: > Commit 5d8edfb900d5 ("iomap: Copy larger chunks from userspace") > introduced high-order folio allocations in the buffered write > path. When memory is fragmented, each failed allocation triggers Isn't it the right thing to do i.e. run compaction, when memory is fragmented? > compaction and drain_all_pages() via __alloc_pages_slowpath(), > causing a 0.75x throughput drop on pgbench (simple-update) with > 1024 clients on a 96-vCPU arm64 system. > I think removing the __GFP_DIRECT_RECLAIM flag unconditionally at the caller may cause -ENOMEM. Note that it is the __filemap_get_folio() which retries with smaller order allocations, so instead of changing the callers, shouldn't this be fixed in __filemap_get_folio() instead? Maybe in there too, we should keep the reclaim flag (if passed by caller) at least for <= PAGE_ALLOC_COSTLY_ORDER + 1 Thoughts? -ritesh