lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3096106.1648714405@warthog.procyon.org.uk>
Date:   Thu, 31 Mar 2022 09:13:25 +0100
From:   David Howells <dhowells@...hat.com>
To:     NeilBrown <neilb@...e.de>
Cc:     dhowells@...hat.com, Andrew Morton <akpm@...ux-foundation.org>,
        Christoph Hellwig <hch@...radead.org>,
        linux-nfs@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/10] MM changes to improve swap-over-NFS support

NeilBrown <neilb@...e.de> 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 <dhowells@...hat.com>
---
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>

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);
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ