From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) (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 8386D1DA4E for ; Mon, 27 Jan 2025 21:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738014630; cv=none; b=Zq0SftdhamcNGTW32k96k7L4vFdw6xq0bo8QJfhR1c/lOZh5X/02goX1ZFDESl6iFXR+56PPnTK/grIvRMPHirfRaLVUAu0s616mCABcvtBwtLACwbN6e4z10jUiiF2VPe2N3rxbrFPwS3yceMe5zKCYuwRnCZNRToKd+RtFYVM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738014630; c=relaxed/simple; bh=7MXh21aODrnGnwzYOh5iLa11U5rYCFcZfxcwyvMPiTg=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=TyR/iBSKSmtMEWfTuxnMeg49D6yd6kUl90LPbnsV201e9kn6yit8K/T2RCuaVOnvZnAwCfwN3yDtOmZagKmXdf466N885hus2oOHR/2BHF2v/kEiw/U/JNTLrpCzLi8oLacNfRIjDWe3k5z/HiQmu/FzUTOyOByuOTs3kU/3O14= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--mclapinski.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=DD+/o76A; arc=none smtp.client-ip=209.85.208.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--mclapinski.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="DD+/o76A" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-5d90b88322aso4060941a12.3 for ; Mon, 27 Jan 2025 13:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738014627; x=1738619427; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=/+GwZcy6oea9sDXucrjwiRlD2OEpidzptTvEnfreSro=; b=DD+/o76AJrZTsftpAxNshriQIEIgCUIvOP64e6kQOaMrJ1Xaus11niEPFnoHQg7fOr bikm/FMvTY7DFle9qZsNkUYyEC3rbd0KOKzrazLaPYDJXoZgGDiCw/J9RkbopM/Dh3Ec /j32EMUShMLLZPMLoC3bnJarb8tJHSHfgKyYTFl6tqNXYq+HUFcfZYxTLKuwm08IhnM0 2kP4MXBSMq+AksxvSqItlD/x+yAhL7wHOZZs1wg3OGt6aiU8OSdHYNXX8D1iBjp5+IJJ PcavNczHbsBGWt7pnaCq2aJ8hCmNAZVkWBdou769gHgpBPhBT21dY7qv6AWyrI6cloKN nNog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738014627; x=1738619427; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/+GwZcy6oea9sDXucrjwiRlD2OEpidzptTvEnfreSro=; b=oG/WFIQ2HHv9FC6cnyaHUxptG0rPxLvAXwSVRK8XG6m22OnB6dB7+KF9rIu1WuQCSI opPAT+hq9AgKik6YUTCRS/DC+oFcIdmpuaxVB+WPZRcIuW3/tV9oxSPkmrDAbK9rcoIk VYX3G10Hl0fwCLZiKVVkHJeIWGQnzToOoRAUwIQes6ylHR7ZRXndsxwQ8DpR/zYf63Cw Uyle+F9HaHRMy/tUIlzhMqkrZqW38xBJnDALUxX5L9KnVU6ZiA4rk4nny8U8cwDtxogT vluB002U7a9Px8TYXPhUEIeG4I2FuULFYnOoMKgczBeA5nFwGJivCSIvqlRokksnfBaM rGDA== X-Forwarded-Encrypted: i=1; AJvYcCX7tPmPgIqOZMyATCKr4PjEpDM3iP2nESENbcWQDC19h0RnkfPWhMHjARD78rejpzKi5m6s820gq8SJ1Lo=@vger.kernel.org X-Gm-Message-State: AOJu0YytiGntWqUAqfQUZ8WNd2rTmZnZhzT+TY+daGEGofzgCarKd0HT 12ki+xsDnf8BYUeWXT3fQ5nVvrBw/ehIHF6jqcf58ZJtM6RGOq7A7nmL9n1nNQrAieyIhHN/KJC veznPWpfgnCfmkGDiiQ== X-Google-Smtp-Source: AGHT+IE7oZO+AY06HPrt6u9q0BfA11TSbQbCT41gIOOlH62klA26q+U/uRgcfbTsi/aTw3yJ5/K2tyWi9xLlu2PM X-Received: from edad25.prod.google.com ([2002:a05:6402:4019:b0:5d2:1b7e:45a4]) (user=mclapinski job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:5110:b0:5d8:211a:4d59 with SMTP id 4fb4d7f45d1cf-5db7d318ee8mr40341298a12.19.1738014626986; Mon, 27 Jan 2025 13:50:26 -0800 (PST) Date: Mon, 27 Jan 2025 22:50:18 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250127215020.4023545-1-mclapinski@google.com> Subject: [PATCH v3 0/2] mm/compaction: allow more aggressive proactive compaction From: Michal Clapinski To: Andrew Morton , Vlastimil Babka , Pasha Tatashin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Clapinski Content-Type: text/plain; charset="UTF-8" Our goal is to keep memory usage of a VM low on the host. For that reason, we use free page reporting which by default reports free pages of order 9 and larger to the host to be freed. The feature works well only if the memory in the guest is not fragmented below pages of order 9. Proactive compaction can be reused to achieve defragmentation after some parameter tweaking. When the fragmentation score (lower is better) gets larger than the high watermark, proactive compaction kicks in. Compaction stops when the score goes below the low watermark (or no progress is made and backoff kicks in). Let's define the difference between high and low watermarks as leeway. Before these changes, the minimum possible value for low watermark was 5 and the leeway was hardcoded to 10 (so minimum possible value for high watermark was 15). v3: Remove gerrit ids from commit msgs. v2: Change commit msgs and document the new sysctl. Michal Clapinski (2): mm/compaction: remove low watermark cap for proactive compaction mm/compaction: make proactive compaction high watermark configurable via sysctl Documentation/admin-guide/sysctl/vm.rst | 17 +++++++++++++++++ mm/compaction.c | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) -- 2.48.1.262.g85cc9f2d1e-goog