Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4134574pxb; Mon, 1 Feb 2021 13:25:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBTnNMOaLzMZYW5CnCuh4w+/1rZdU1QedMqDOZz0AWO6QPwo1UdtwevEU5afE40G/UD1EN X-Received: by 2002:a17:906:f6c7:: with SMTP id jo7mr7498412ejb.178.1612214752152; Mon, 01 Feb 2021 13:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612214752; cv=none; d=google.com; s=arc-20160816; b=tc6MdZY2/AoLxK8Z/Vjjxck8Phg0FHlvYIjLJFcESwKMNZnij2OnNg58Mey+OW6ZhE ReoAX87NfoZ69rhxsdT4jzFFclK6xIZLIqUQuu+v35d8YTG3eZQ/bGUiaM+Dg1k/4v5D mMpU4Swn6VMueuU65QuFG8kn+WTTX1ngZrVErL/p9bTDjp/6VGbnpy3fTun7gJBBx97K w3f9DDjP68OEWHouO1LRjwdjvr2Ci5y5lxYy3bl33iNTLkoSmj+yrQF0rEl3HiCbLFVT Qfe9tskWn7kbJHsSuHYBen/6DZe6nwj5aSFQEdlus8t38LT3XTu3mfi3T3/ph+Spx47t B0Sg== 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=yOWrw7a+Nf/KygeG78AKIm4KgYP1X9MsGHak8Pcn4zg=; b=zso4fW5J9LICUE4LTB9iITodsFJMxX3CbTQE40h5lKFY1uvwkrjxq/cNXMDTr9O+UV n3NJs+b8uxw+uiYoFT7sqwebU8KttFmfSSeFCI2UPROCbF5A7/pKwinGpWetD2+0r3Nf kfMEusaQcXiQ7js8vH9b2sJUgFfKRWSiDDz0DOOggQM5WRxJLRfbuEc1IAJJMrY3BLP4 sbb8Dy1QvfOMiJxGhisfjfdDAit6As3LM9VwKtMwMOqGmMpNnypjleKOkFiHVaMHiW9J 13Z1Zxz/OeNKOI7iqDRmIeP1bW+LCq3MO8l04IBqR+Z96bITSFBCWDePv7PjS6F/a4q/ 8qYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=o5jpmsDs; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si5030370ejc.466.2021.02.01.13.25.24; Mon, 01 Feb 2021 13:25:52 -0800 (PST) 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=@google.com header.s=20161025 header.b=o5jpmsDs; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232165AbhBAVXk (ORCPT + 99 others); Mon, 1 Feb 2021 16:23:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbhBAVXj (ORCPT ); Mon, 1 Feb 2021 16:23:39 -0500 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDF65C061573 for ; Mon, 1 Feb 2021 13:22:58 -0800 (PST) Received: by mail-oi1-x234.google.com with SMTP id a77so20461328oii.4 for ; Mon, 01 Feb 2021 13:22:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yOWrw7a+Nf/KygeG78AKIm4KgYP1X9MsGHak8Pcn4zg=; b=o5jpmsDsoy2ji8gpSb36ZTjvFoA1b9ZgnxGP7BNO941bOozBAgb85HxfqP7ke9weQZ SpK7oyNLgUjJX2fDxDZQDiKj5OnmmA1iQLR9Pql9Y7kN07+suHgVlZpX849oC7jsFT57 cW0DfuuM2Hw+BuZiiWMrn3sKFp79qYjY1DUgakhu1dQ4GghBwUHxOdFyECtLgJOMYpS7 W8pMJq1aTdPk1qovkiZBrTCtatjVdjA9o1hN0/ieRYZ0JWHw8Q5D/5SEmXQsU5cXpIOn sy0df7yFz7oIgQHyrO6/mHCdDwFjmVgfsBhSFTnEzLu5c/U7EipCXJRYolPbbg8FIuOo 2P8A== 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=yOWrw7a+Nf/KygeG78AKIm4KgYP1X9MsGHak8Pcn4zg=; b=ZUMTHmBrXBD08K9pKBCezM6rMdOodyXnIEJ06g8VPhVqsgUZtccKW4fjgYL1dE0/5d NLuvcGYbnqv3vRvvzdLUaeDfCL5xJeC6L+7IR7XuK1s3b6w534K+CfZqvMDw/NvvhNwH LdGFPTGPjEX6rpnoiJk83Ph/gQyLGvpEWhWJGa8bEchl13jfdpHIF+M6Z+KKwsr/7QKm nRC/ZY7boVYc3pP2L6VvI4i0VuLYlAuq+FcEC/7CpDqEjVpDhZumXCm4fHIR1dDSkVMr /k/vVMBaoNS08BaO72QYE/JzoBDtCzihm2tn+j+q5AV3GLzkQM6DF0yBRUlcr9rFGpA1 eKqQ== X-Gm-Message-State: AOAM532aSBP44LRGS//9ukpWoXL62cTXdShuok96IR6dbIYDnVjeoA6K jHuHJY5on2D9xnns8VUawp3M7lnGO6FfRRYqO2ID4g== X-Received: by 2002:aca:be0b:: with SMTP id o11mr575501oif.42.1612214578188; Mon, 01 Feb 2021 13:22:58 -0800 (PST) MIME-Version: 1.0 References: <20210201183017.3339130-1-jxgao@google.com> <20210201183017.3339130-4-jxgao@google.com> <20210201205759.GA2128135@dhcp-10-100-145-180.wdc.com> In-Reply-To: From: Jianxiong Gao Date: Mon, 1 Feb 2021 13:22:45 -0800 Message-ID: Subject: Re: [PATCH V2 3/3] Adding device_dma_parameters->offset_preserve_mask to NVMe driver. To: Keith Busch Cc: Erdem Aktas , Marc Orr , Christoph Hellwig , m.szyprowski@samsung.com, Robin Murphy , gregkh@linuxfoundation.org, Saravana Kannan , heikki.krogerus@linux.intel.com, rafael.j.wysocki@intel.com, Andy Shevchenko , dan.j.williams@intel.com, bgolaszewski@baylibre.com, jroedel@suse.de, iommu@lists.linux-foundation.org, Konrad Rzeszutek Wilk , axboe@fb.com, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Why is this setting being done and undone on each IO? Wouldn't it be > more efficient to set it once during device initialization? > > And more importantly, this isn't thread safe: one CPU may be setting the > device's dma alignment mask to 0 while another CPU is expecting it to be > NVME_CTRL_PAGE_SIZE - 1. I was having trouble getting the OS booted when setting it once during initialization. However when I rebased to the latest rc6 this morning it seems to be working with setting the mask on probe. I am still testing out and will appreciate any idea what may cause the nvme driver to fail with a single mask. -- Jianxiong Gao