[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MN2PR12MB43440D6E37E35DAF962F556EC29A9@MN2PR12MB4344.namprd12.prod.outlook.com>
Date: Mon, 1 Mar 2021 23:14:56 +0000
From: Ralph Campbell <rcampbell@...dia.com>
To: Alistair Popple <apopple@...dia.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"nouveau@...ts.freedesktop.org" <nouveau@...ts.freedesktop.org>,
"bskeggs@...hat.com" <bskeggs@...hat.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
CC: "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"John Hubbard" <jhubbard@...dia.com>,
"jglisse@...hat.com" <jglisse@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>,
"hch@...radead.org" <hch@...radead.org>,
"daniel@...ll.ch" <daniel@...ll.ch>
Subject: RE: [PATCH v3 6/8] mm: Selftests for exclusive device memory
> From: Alistair Popple <apopple@...dia.com>
> Sent: Thursday, February 25, 2021 11:19 PM
> To: linux-mm@...ck.org; nouveau@...ts.freedesktop.org;
> bskeggs@...hat.com; akpm@...ux-foundation.org
> Cc: linux-doc@...r.kernel.org; linux-kernel@...r.kernel.org; dri-
> devel@...ts.freedesktop.org; John Hubbard <jhubbard@...dia.com>; Ralph
> Campbell <rcampbell@...dia.com>; jglisse@...hat.com; Jason Gunthorpe
> <jgg@...dia.com>; hch@...radead.org; daniel@...ll.ch; Alistair Popple
> <apopple@...dia.com>
> Subject: [PATCH v3 6/8] mm: Selftests for exclusive device memory
>
> Adds some selftests for exclusive device memory.
>
> Signed-off-by: Alistair Popple <apopple@...dia.com>
One minor nit below, but you can add
Tested-by: Ralph Campbell <rcampbell@...dia.com>
Reviewed-by: Ralph Campbell <rcampbell@...dia.com>
> +static int dmirror_exclusive(struct dmirror *dmirror,
> + struct hmm_dmirror_cmd *cmd)
> +{
> + unsigned long start, end, addr;
> + unsigned long size = cmd->npages << PAGE_SHIFT;
> + struct mm_struct *mm = dmirror->notifier.mm;
> + struct page *pages[64];
> + struct dmirror_bounce bounce;
> + unsigned long next;
> + int ret;
> +
> + start = cmd->addr;
> + end = start + size;
> + if (end < start)
> + return -EINVAL;
> +
> + /* Since the mm is for the mirrored process, get a reference first. */
> + if (!mmget_not_zero(mm))
> + return -EINVAL;
> +
> + mmap_read_lock(mm);
> + for (addr = start; addr < end; addr = next) {
> + int i, mapped;
> +
> + if (end < addr + (64 << PAGE_SHIFT))
> + next = end;
> + else
> + next = addr + (64 << PAGE_SHIFT);
I suggest using ARRAY_SIZE(pages) instead of '64' to make the meaning clear.
Powered by blists - more mailing lists