Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp633921pxk; Thu, 24 Sep 2020 14:29:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvW2H5d9Uaqqgqkp3Bt6/uKTpi2wZpkubXNyxsbOQMG4a84OlKXyV7OOyiqILxrIFpDD7O X-Received: by 2002:a05:6402:cba:: with SMTP id cn26mr802234edb.230.1600982970264; Thu, 24 Sep 2020 14:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600982970; cv=none; d=google.com; s=arc-20160816; b=LD+QkaVdXjDjFbCRmvdzbLqN4bVc+uR+ktuRxPW+DUt8GLxmtJpG+9Pz4dXtTqLpto UEfH2OWvA9rV3yankiM7y77izoodzndbOJ5RRpCc4tF0Ert2DLt8nK7r59lBlaq/PGYr RAl51//PajtvdaCGN6lUVe6eKDl4qijAT/N8FbFeoWLmxr3RnI5UubxcjqO5WE8RxnFP LqxaOdQhqoWusy6eZevP/0pTbePNq5OZBaRh6GcubidXYTeMDY2mdIadeRHt4/IP90FZ cTJ/yGc0xxewXzAQxt1sFwsiajUP1vIWsRXul6fhVWcvXg/8Ni9OaHxLQyrE1n+rzFkO Y3pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=in8Rg86VvfYuzQh6U7/hDwBGxF8v1AUSBmpO9E789oQ=; b=M6hJrv56GVGNsQBamvNYZYt+5laEpm5AzDJCz+N+biEJwUd0UUuDWSUHRmL0lsz/Iw 3o2kC6f1iHkBKLa37Xa3LuqFEaoNdWVRH/g894aWnbeIPY643nEKP4okFANoXRDLmmrj NnltYDlM7Nusqcl/PvCfhZvxVWNDQcv0xZ4J6zY36+RLA/8sJR0FN/5wkQMZztCxGoI5 f+sp9QZyGDT4iNoDGz4rC5a/R1pYOxHh6HINwcrHdAZNdpH4zBSk3k7LPSWMfKabVxY1 cj4fB5IDK/A57vJnAdBUe0h0Uf+2IMTlRmHYS4lPfVRoWbuvmFBwlhhPcqGPGJFpRBk1 GUfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Prvekm5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si510172ejc.723.2020.09.24.14.29.05; Thu, 24 Sep 2020 14:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Prvekm5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbgIXV0c (ORCPT + 99 others); Thu, 24 Sep 2020 17:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbgIXV0c (ORCPT ); Thu, 24 Sep 2020 17:26:32 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11EE4C0613CE for ; Thu, 24 Sep 2020 14:26:32 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id e23so794956eja.3 for ; Thu, 24 Sep 2020 14:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=in8Rg86VvfYuzQh6U7/hDwBGxF8v1AUSBmpO9E789oQ=; b=Prvekm5qZ88alNocW0qFgn9cNj4Z7QPimTG+psr7zIONUFcW/sHjWqo//GgbjmL/pf Qyi3kbx59KsXbxbt5zVjLpfbDD5wqchk4ncB4m9x1sIIdLR7f/KrMYOWvVfcwXkCNzE0 mMBAE2hS6VPIeqVq5TwF/2xMYdk/evhZkCGinbxKW92OUZfrQKMIfnXtfyq1OMrF6fiI 7hM62hDuLhBPU6MmQIBfypJfSQi8cEJujTeoPII/G5Q0qktgQrL9sWDMLtSQcH2vxa1e pAec2dHwsj0ZX6DcdP0RlhkEqNAcUa606Ui3etrBGY/9HZZN4lq2/eQdVX6P9Cnh39Wc BhzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=in8Rg86VvfYuzQh6U7/hDwBGxF8v1AUSBmpO9E789oQ=; b=goTwGR9dlDajqb497e5Uh8plxy3np2CJPmFPu/MNHWhzb7k8NiqXkuX9qkbSE93mLx xZbSjsI0B9k8FAV9Ay0iS7RFkccz0CC42XwHm2zJRbQoh0CQFF/j6Sq16RxPbyCSJv97 A1q8809PLYJ80QBORf5msjv3VVePRNc/Ko8yX+o8YFVD6WQL8svX5TRRucE/kdM+klWk KpgYpCsxH1zjvRTv5DzvlcsAc4+t6kfFhUAdlWAa+ATcXeuvk4k0MvOj8vxEjYRhUYoF l7WpxLXc0xeiPDRto9ddfrVkufi7Si3k4WXFtgguifsvxAUBL3VXsNgAtnvRVDe7CC52 hRSQ== X-Gm-Message-State: AOAM532cQI3FmU57qMvs9DfY0XuJ4M8dKJPP1OjRV9cutkg9FXv+74DG i9v/F1tFi0jgHkrigpxokFwWCST7+Dn63hWbfYdY2A== X-Received: by 2002:a17:907:4035:: with SMTP id nk5mr592391ejb.418.1600982790747; Thu, 24 Sep 2020 14:26:30 -0700 (PDT) MIME-Version: 1.0 References: <159643094279.4062302.17779410714418721328.stgit@dwillia2-desk3.amr.corp.intel.com> <159643100485.4062302.976628339798536960.stgit@dwillia2-desk3.amr.corp.intel.com> <17686fcc-202e-0982-d0de-54d5349cfb5d@oracle.com> <9acc6148-72eb-7016-dba9-46fa87ded5a5@redhat.com> <28ad3045-9238-2a77-d74d-9660a36aa4da@redhat.com> In-Reply-To: <28ad3045-9238-2a77-d74d-9660a36aa4da@redhat.com> From: Dan Williams Date: Thu, 24 Sep 2020 14:26:19 -0700 Message-ID: Subject: Re: [PATCH v4 11/23] device-dax: Kill dax_kmem_res To: David Hildenbrand Cc: Joao Martins , Andrew Morton , Vishal Verma , Dave Hansen , Pavel Tatashin , Peter Zijlstra , Ard Biesheuvel , Linux MM , linux-nvdimm , Linux Kernel Mailing List , Linux ACPI , Maling list - DRI developers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [..] > > I'm not suggesting to busy the whole "virtio" range, just the portion > > that's about to be passed to add_memory_driver_managed(). > > I'm afraid I don't get your point. For virtio-mem: > > Before: > > 1. Create virtio0 container resource > > 2. (somewhen in the future) add_memory_driver_managed() > - Create resource (System RAM (virtio_mem)), marking it busy/driver > managed > > After: > > 1. Create virtio0 container resource > > 2. (somewhen in the future) Create resource (System RAM (virtio_mem)), > marking it busy/driver managed > 3. add_memory_driver_managed() > > Not helpful or simpler IMHO. The concern I'm trying to address is the theoretical race window and layering violation in this sequence in the kmem driver: 1/ res = request_mem_region(...); 2/ res->flags = IORESOURCE_MEM; 3/ add_memory_driver_managed(); Between 2/ and 3/ something can race and think that it owns the region. Do I think it will happen in practice, no, but it's still a pattern that deserves come cleanup.