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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C038C433EF for ; Thu, 31 Mar 2022 08:13:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232592AbiCaIP3 (ORCPT ); Thu, 31 Mar 2022 04:15:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbiCaIP1 (ORCPT ); Thu, 31 Mar 2022 04:15:27 -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 3FA61BF74 for ; Thu, 31 Mar 2022 01:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648714416; 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: in-reply-to:in-reply-to:references:references; bh=XBSSjR/9FQIi28vZKv97ezZh1yar1AT2JnPj2c6QrxE=; b=hvH3lU3LV8VDnf4mx33dx54TnwaCrURrt0MO7zXFyBsa6DAhdlekOZmNx6DAMxLPkP7KEj brth1vwXCfYIVNaAIk84N43eYJs9itdRZuJMGEOPWJGrUDPosjSEIoo3twtEyP94YEfxfu Y8GUHXVEawNL/ef2d+V8OkiIOH2F46I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-32-2bVHFnLgO9mOpHl4Sg9Y2w-1; Thu, 31 Mar 2022 04:13:30 -0400 X-MC-Unique: 2bVHFnLgO9mOpHl4Sg9Y2w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 15392899ECD; Thu, 31 Mar 2022 08:13:29 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 987B240D2821; Thu, 31 Mar 2022 08:13:25 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <164859751830.29473.5309689752169286816.stgit@noble.brown> References: <164859751830.29473.5309689752169286816.stgit@noble.brown> To: NeilBrown Cc: dhowells@redhat.com, Andrew Morton , Christoph Hellwig , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/10] MM changes to improve swap-over-NFS support MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3096105.1648714405.1@warthog.procyon.org.uk> Date: Thu, 31 Mar 2022 09:13:25 +0100 Message-ID: <3096106.1648714405@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NeilBrown wrote: > Assorted improvements for swap-via-filesystem. > > This is a resend of these patches, rebased on current HEAD. > The only substantial changes is that swap_dirty_folio has replaced > swap_set_page_dirty. > > Currently swap-via-fs (SWP_FS_OPS) doesn't work for any filesystem. It > has previously worked for NFS but that broke a few releases back. > This series changes to use a new ->swap_rw rather than ->readpage and > ->direct_IO. It also makes other improvements. > > There is a companion series already in linux-next which fixes various > issues with NFS. Once both series land, a final patch is needed which > changes NFS over to use ->swap_rw. This seems to work by running sufficient copies of the attached program in parallel to overwhelm the amount of ordinary RAM. Tested-by: David Howells --- #include #include #include #include #include int main() { unsigned int pid = getpid(), iterations = 0; size_t i, j, size = 1024 * 1024 * 1024; char *p; bool mismatch; p = malloc(size); if (!p) { perror("malloc"); exit(1); } srand(pid); for (i = 0; i < size; i += 4) *(unsigned int *)(p + i) = rand(); do { for (j = 0; j < 16; j++) { for (i = 0; i < size; i += 4096) *(unsigned int *)(p + i) += 1; iterations++; } mismatch = false; srand(pid); for (i = 0; i < size; i += 4) { unsigned int r = rand(); unsigned int v = *(unsigned int *)(p + i); if (i % 4096 == 0) v -= iterations; if (v != r) { fprintf(stderr, "mismatch %zx: %x != %x (diff %x)\n", i, v, r, v - r); mismatch = true; } } } while (!mismatch); exit(1); }