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 X-Spam-Level: X-Spam-Status: No, score=0.2 required=3.0 tests=BAYES_50,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66548C4727F for ; Thu, 24 Sep 2020 21:26:36 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDF5E2344C for ; Thu, 24 Sep 2020 21:26:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="Prvekm5q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDF5E2344C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 74A0E152E66D9; Thu, 24 Sep 2020 14:26:35 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::643; helo=mail-ej1-x643.google.com; envelope-from=dan.j.williams@intel.com; receiver= Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6AB1C152E66D6 for ; Thu, 24 Sep 2020 14:26:32 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id z23so707189ejr.13 for ; Thu, 24 Sep 2020 14:26:32 -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=c/CNoAFyyuFiaKU5Yq2NnusEkZV7f4YLO9hUVC5c9K0xl5qlbowSUhzgHioNlJCMcY gnZNJ1XqjPsv1ojeoTXJGX1vUNAkSuBVEPw+2LFiMUWSuXMFFAHTO/ll+Xn9GFpW4a36 IuS0ydqp17jGVsx0UpRl3LcQTPo5jbak5iz9EfVM+unlPtoXHatF8KPf38KVMnApaGgt SnEfhMuGjSdQSN+QAarlFAWgcnyD5xSxKRwZN0CDuL6F3Wrd3nLsa+LZ7X11H+tup1CB 1bSLME4gCPQWo8x9mhfVGATqN5TybpNw6FPykQngUjEmDEYJBlZuGNCxm1Os5CMUh97c 91WQ== X-Gm-Message-State: AOAM532AimvogL+GuWhvo6wriLzr7CoSNvQy09kaSqsFAwPDVnk3txXZ M8othNYyc4kBrwpVVrtpgC5NMNcC54S48qxIw055jQ== X-Google-Smtp-Source: ABdhPJwo2nc1Tk13TPjt0rD146GmflS4xaeaqP6B2BkyjnC8iqLNN+AT1GEdOa+lozWWeYUYn6ojXC5A3ZlNsX+AQxo= 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 Message-ID-Hash: J3VLIOGDBIUGWYOXI7GLTH4NMKSWSFNA X-Message-ID-Hash: J3VLIOGDBIUGWYOXI7GLTH4NMKSWSFNA X-MailFrom: dan.j.williams@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Joao Martins , Andrew Morton , Dave Hansen , Pavel Tatashin , Peter Zijlstra , Ard Biesheuvel , Linux MM , linux-nvdimm , Linux Kernel Mailing List , Linux ACPI , Maling list - DRI developers X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit [..] > > 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. _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89F92C4727E for ; Thu, 24 Sep 2020 21:26:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45CC423A1B for ; Thu, 24 Sep 2020 21:26:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="Prvekm5q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726500AbgIXV0c (ORCPT ); Thu, 24 Sep 2020 17:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbgIXV0c (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 1CAA7C0613D3 for ; Thu, 24 Sep 2020 14:26:32 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id j11so819459ejk.0 for ; Thu, 24 Sep 2020 14:26:32 -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=U45Eqf1It5e1dSFpMwTjCQuAiN9cK7W5Tp+OGVaJhXafQ0F7tse00geJUgNEctrdw9 ir70NxqdR67QFAEA09LOKpY/YWMGWFkPU6deS53wKCzVh57p6qk0yjoHocH1a6p1oeKB NzEqujn2dS91URRz4nAfLBJXYv//QehrTq6Hi/7gZ04nWdRsB9FHLA+pE2lXYWIq1kfi 5+kxStBrQtAsfj1S5HrSxTDa+fMpPtOOlfKTIedPSBj2+SdI6+wfPvnKT0elfPoankxK 7P0slIop7oZ5qlJ0TC0rf6MpDFee1tTaX590knXWH2507Bpj5XzD+UcI+pWdzZA0oWf3 9Hww== X-Gm-Message-State: AOAM532Rj+oeOvMIy4WqXaRGd5w91hmxSjShT7QzYyQL7IkKlxulrsKS Db7CHGOxXAa9HQSMRb4fsnTuPlss9HexPEmbi9huIw== X-Google-Smtp-Source: ABdhPJwo2nc1Tk13TPjt0rD146GmflS4xaeaqP6B2BkyjnC8iqLNN+AT1GEdOa+lozWWeYUYn6ojXC5A3ZlNsX+AQxo= 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-acpi@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. 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5158C4363D for ; Thu, 24 Sep 2020 21:26:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 54A8B239E5 for ; Thu, 24 Sep 2020 21:26:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="Prvekm5q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 54A8B239E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 577506B005C; Thu, 24 Sep 2020 17:26:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 528F16B005D; Thu, 24 Sep 2020 17:26:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 416E18E0001; Thu, 24 Sep 2020 17:26:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 21C3B6B005C for ; Thu, 24 Sep 2020 17:26:35 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CDEF8181AE865 for ; Thu, 24 Sep 2020 21:26:34 +0000 (UTC) X-FDA: 77299239108.26.ship29_3506d9327162 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id A8B661804B66A for ; Thu, 24 Sep 2020 21:26:34 +0000 (UTC) X-HE-Tag: ship29_3506d9327162 X-Filterd-Recvd-Size: 4637 Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Thu, 24 Sep 2020 21:26:33 +0000 (UTC) Received: by mail-ej1-f66.google.com with SMTP id gr14so809870ejb.1 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=nIix+OsN/4nF+sZXKx1wF0e4QEGqcTDbCW4/bHGkgVKOGGXmeIAwu6ghk44/+ugMoB Z5TE62EG31weduFWhqJxM266a+wGKyJit35HiEKArP/ifYlJjCCVtxLRY5M4bOT2mCii aOMbRD3rk84F37Q79+2+KH3eVdxqwd1vpc8plzeN9Q/pRWnxZFRuVhqCVzj0LDKZ16ZL fhGZOAUbRy06uJDWJq+rTn08KO93dKjMFJJCguh2ykaBCuernbO/DDy9U8RlFkHhSQHy Pa/4ewKRa9q15DgtN7gfJYJKncVgkPLunViZoHvqcWub3/O1sijXOF91A6LmCXAK+g9g /WDA== X-Gm-Message-State: AOAM533ARy1jvlE6L9+0F80se+CeJOAgnbJFC8MpejRk1/Sb5lEnSF95 OkcwM0A0YbpLr3HtpwX3PKYIwMPtb9eTTfkHE3i3gQ== X-Google-Smtp-Source: ABdhPJwo2nc1Tk13TPjt0rD146GmflS4xaeaqP6B2BkyjnC8iqLNN+AT1GEdOa+lozWWeYUYn6ojXC5A3ZlNsX+AQxo= 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: [..] > > 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. 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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 140ABC4363D for ; Thu, 24 Sep 2020 21:26:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F3312344C for ; Thu, 24 Sep 2020 21:26:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="Prvekm5q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F3312344C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BFEA36E02C; Thu, 24 Sep 2020 21:26:32 +0000 (UTC) Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 16E386E02C for ; Thu, 24 Sep 2020 21:26:32 +0000 (UTC) Received: by mail-ej1-x642.google.com with SMTP id lo4so748734ejb.8 for ; Thu, 24 Sep 2020 14:26:32 -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=mNig8jXfYfkUgeK1RLNX3iZG9ZlZOlwCc9yGZ/umQSz0dahfJ3jkiQ3VGkxXIG7Nmv CkNSRukrApHYFF7rFzNkPsWp2f6q5PHFkX/ttR1CmSAkN29M8k6Un+KpOSUfkf4wlGyY qf6RLgOmQZL5lPXoQGAV4GYD5r3k/OHtirllZk9ZBxSjgbTxwGEHgp16NLU0Og6h8Z0S 74i7Vgw7R6Ykae/lzq3Rh2wT7qUo4pMBsCMI7Z3tB8KCUYtNUrR11YTMVhnwzyf1Yqm0 QQ+MqS3IhiiOHYT4Kcm66KTLQgIEEaA9MwZjnKnwkwUwJrHEU2ZPl9QGt+m7BHnRvz46 5sIA== X-Gm-Message-State: AOAM531JGocOum8ewq3xiFSszpUvTVQcHAslo43dz6RUMeHJpeeak/5/ emuZE17N4wEZoq57ANEG6hU2DQfWZAQ6WN4B3GBsKQ== X-Google-Smtp-Source: ABdhPJwo2nc1Tk13TPjt0rD146GmflS4xaeaqP6B2BkyjnC8iqLNN+AT1GEdOa+lozWWeYUYn6ojXC5A3ZlNsX+AQxo= 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pavel Tatashin , Ard Biesheuvel , Peter Zijlstra , Vishal Verma , Dave Hansen , Linux Kernel Mailing List , Maling list - DRI developers , Linux MM , Joao Martins , Linux ACPI , Andrew Morton , linux-nvdimm Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [..] > > 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. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel