Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3969961yba; Wed, 17 Apr 2019 01:36:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqMGMsKSRUDt9er1m6jwhcUib4p0qmJ5CEKoYoSwAHkJjhyU18AbyjCLN4yIozmakUc+Bf X-Received: by 2002:a17:902:8ecc:: with SMTP id x12mr87634062plo.0.1555490205470; Wed, 17 Apr 2019 01:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555490205; cv=none; d=google.com; s=arc-20160816; b=ECjD+fQfjXQIJ69dYT6vnWEEf0pWs+y4psh9g4IZnTiD/OwHKPSzwECIqhKxcufQ/i dMLuWgcUQd9SfPrdH8A6BBZSRmuttwjnUdy2zbKKsvap1YiR2u6uCobsOy5VFxlHICKN jLFCbG6JN3ZogScPJqxbxr7U7fyth/l3Bjq5HQBY8FfnOimJU2RgqrxH/9uSD9VjT/5f Rnc2RElljK6AlWBfeKeEUW28yIp4D5Kd1YtcXIe+IoEIMj+nJdTevuQBL2+XXSpW2jDU Cf9TpkeTcoJbMEm4BNerNghX5pWhf0s2XSF1JtDeLeEo1khteFLIOdcPRDW0ur8+//Ku L5hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=HE9AdSyj6Xu+M4CDNxaUyXeYyEky8JqgeK1vrcackXY=; b=IPxOrfSLDJm1Lldo3lf1nk2ZK5kMLJOovoRuwVijqFKLTQdULjqEl122TIWuNOR8CQ Db2jkCYIUdkuOhM8uVYx0+E9m9seHs1vRpvtP/XbPsM+ef3sX2DjaCnE/nq1XuEfiOS6 zo09Lv5NTPduh/lhlp7oXjFDnECAeMnLVIxgUmOaDZ2g8D30xRtQGgaNrfpeJEkA9r/k F7wlInAlupI9EoWMLEzXTSGGKgbUwE7CYdHlagUXtFKA53EZHTVmRzKoA2vccc6GQGzt 9OMDsjjXdoM/mJApqVzKnYt93jtOEJNtDalCP/X0zmQB4Nn9YtwJqvo+twuNwVx7+DqJ pFpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K6OCI8g8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g87si29901203pfg.44.2019.04.17.01.36.29; Wed, 17 Apr 2019 01:36:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K6OCI8g8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728446AbfDQIfP (ORCPT + 99 others); Wed, 17 Apr 2019 04:35:15 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35010 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbfDQIfP (ORCPT ); Wed, 17 Apr 2019 04:35:15 -0400 Received: by mail-lj1-f193.google.com with SMTP id t4so13137021ljc.2 for ; Wed, 17 Apr 2019 01:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=HE9AdSyj6Xu+M4CDNxaUyXeYyEky8JqgeK1vrcackXY=; b=K6OCI8g8E1m2UF7ZmFB5XQHjq7lCGpCRt5EP3S/RYWBTjDZKQy+vkRJ1YLzJxdAMO2 gFgiZwLZDo0nGfIFeLDqho1yCZok4AnOwB8xj5U+jQqzyCYIwSvCgblhUytiX7r+qzlm 9NUw4uBpzm/BQKaupHy+yN3dPC8wcMyAu5l3UlFcKhQH306tKiICIHF+AkKmwnou09F4 eCx2zUPWQQx0/K76ybi2GlZA7tAvQ4fEyj19duwnU7fw/WV4fDGMnskt6ttdZ9gL2n7y jNszH93UPC20ttfkS/w8OnUVC285KZeEef5ITr26Nu97XAyZOnkT8ifH9+FFf8mbAl4h Z0mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-transfer-encoding; bh=HE9AdSyj6Xu+M4CDNxaUyXeYyEky8JqgeK1vrcackXY=; b=ipdrUunnvPL4zkLV4mHY1hJ7hpMHj6vMlJt6D+buEcxO9hLURUcud7Hg1O5W7PP6gn 6mUk5pKtXq1F/xobybouFe3WkgK7mZC+93c6WYXekI545Whf5hC52ceL+KASGaVs8aJ3 Z12ri+qt+MJhsdrRRg/YpQCdqSJ/BVcsuFRThhPgc/EcpIoQIxriywql3Owr2s5tR3e2 1YWhqoU9ru5sWaCjqFNKlvobYSVkkMqWbWX/4HjoEpuSAVU9XIJhKuT4SYts+BGmkXNN mIc35YsVP68xlqJF5OJPBSFe9MJpkodwErWgr2l7yXV2Sw0W5j/W1QxeLqn9bOGQhwMo GrvA== X-Gm-Message-State: APjAAAXyK9LyFJ4O8q0Ngg6OBPAxEOfIiS7L25Do2XNB7GXrX9MlTLRa Jz5sABQEoYt44uRvpZycKdY= X-Received: by 2002:a2e:9811:: with SMTP id a17mr35692132ljj.96.1555490112620; Wed, 17 Apr 2019 01:35:12 -0700 (PDT) Received: from seldlx21914.corpusers.net ([37.139.156.40]) by smtp.gmail.com with ESMTPSA id s24sm10762311ljs.30.2019.04.17.01.35.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 01:35:11 -0700 (PDT) Date: Wed, 17 Apr 2019 10:35:10 +0200 From: Vitaly Wool To: Linux-MM , linux-kernel@vger.kernel.org Cc: Dan Streetman , Andrew Morton , Oleksiy.Avramchenko@sony.com, Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCHv2 0/4] z3fold: support page migration Message-Id: <20190417103510.36b055f3314e0e32b916b30a@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset implements page migration support and slightly better buddy search. To implement page migration support, z3fold has to move away from the current scheme of handle encoding. i. e. stop encoding page address in handles. Instead, a small per-page structure is created which will contain actual addresses for z3fold objects, while pointers to fields of that structure will be used as handles. Thus, it will be possible to change the underlying addresses to reflect page migration. To support migration itself, 3 callbacks will be implemented: 1: isolation callback: z3fold_page_isolate(): try to isolate the page by removing it from all lists. Pages scheduled for some activity and mapped pages will not be isolated. Return true if isolation was successful or false otherwise 2: migration callback: z3fold_page_migrate(): re-check critical conditions and migrate page contents to the new page provided by the system. Returns 0 on success or negative error code otherwise 3: putback callback: z3fold_page_putback(): put back the page if z3fold_page_migrate() for it failed permanently (i. e. not with -EAGAIN code). To make sure an isolated page doesn't get freed, its kref is incremented in z3fold_page_isolate() and decremented during post-migration compaction, if migration was successful, or by z3fold_page_putback() in the other case. Since the new handle encoding scheme implies slight memory consumption increase, better buddy search (which decreases memory consumption) is included in this patchset. Vitaly Wool (4): z3fold: introduce helper functions z3fold: improve compression by extending search z3fold: add structure for buddy handles z3fold: support page migration mm/z3fold.c | 638 ++++++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 508 insertions(+), 130 deletions(-)