Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1040939pxu; Mon, 23 Nov 2020 10:06:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4CVI4XksEYupy8cccGHGHLzW+3IdIMOCyjL5G0sPkW5HrE6OY1T39PiIByMvIvsuGwoSH X-Received: by 2002:a05:6402:1350:: with SMTP id y16mr375156edw.360.1606154762955; Mon, 23 Nov 2020 10:06:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606154762; cv=none; d=google.com; s=arc-20160816; b=rQZXQsOGf9ZiE7vQxa80k4Yg8+GPvosau3/EoCnXHHW1txZE0a8UIZMm79eTHCYa7z 2fJmlxGWfGwI4CImvTDWhcaniMmQTNnWay1Owq7NYbobMpcBLkyZtr/Z+f8ZvnuPUHwh fwI8t87sWYbZCCyzf3HlpUhWVBcwNHz4J2jNkwWuK93TEFRIPImKTsBLBN2ppA8XXG+9 RL0e3y8cJCGywnS/26IfsBZd40mYqlklF+/BB1p70e/I+/Vg4uAmsB4ueTqlc0Hvd31I xfGlucqEmQ/xTK7LpfQ1VduSwSYlf9S8dxoK0INxA35HRxAs0x7kAtbyBZPXl8VnmXCi 9pIw== 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=cckI8TzzI9h0pCxlvdtQ9ZkM+PSEdfqZ2zz4bNJ07Kc=; b=fCEK3YtUwIZ2UB9LRFyw2CsqR6yxzWb/WCQ0glb1x3HOGyaj7HAQRb1r1ptevVS/Vi PTopR2K1e6sXL3oinOIqnwCLEBuqjasycSLSq49j7fR68U9Plaa3cbds4McTunrrpIqE nHIX4ja4F1QA3s5SxB+u9dho/tx+xmgU/SGCNMlDwhvvxuaTuBTnxFXjh8EsD+nSDFsK Div1bmZAG428daH1mKifa8Jlfe1Uj1Wc6Y02pn8W1KU8BFWwdSeOFBawIEzyjyLkON7k xZXiNYri6x7BU0suSlLb8XDJLcW1PJN1FS1fZrfJ6tJM9VKz9HQ/AFc6ddsAhLnzOusJ 9Icw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qzeVD8Dp; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si7102318edj.521.2020.11.23.10.05.39; Mon, 23 Nov 2020 10:06:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-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=@gmail.com header.s=20161025 header.b=qzeVD8Dp; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388721AbgKWSFf (ORCPT + 99 others); Mon, 23 Nov 2020 13:05:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388704AbgKWSFf (ORCPT ); Mon, 23 Nov 2020 13:05:35 -0500 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B43C0613CF for ; Mon, 23 Nov 2020 10:05:35 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id l5so18038090edq.11 for ; Mon, 23 Nov 2020 10:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cckI8TzzI9h0pCxlvdtQ9ZkM+PSEdfqZ2zz4bNJ07Kc=; b=qzeVD8DpCvVo6qZK3u6vfQ6LORjyzPJxLmvg0q0Og7+63Cq2z4THMzkYBz1vPxLXmG pRPi60TWkjhyU9N6cIBQY2Y3FXb+cGzfj7GkQcEHN0h8+OzIo/IBIe7XnQzimPrBf+9C qAgOiiAR52JrR3y+Y7BK7IXyL/+53KKZNphVFhdJCOpKZc++yqSfS9/UOIzHRFQMtvxa MO2fsRq3j8IU0RyB8veWC5SChpShUf1M9YPmFEnwjg1q6gLc3VtMxVfjpAPnp5aJBbby t0RhzC0rj+fhI1xPuKRULLUJ99YFR4fL5YS3UlGrUx1diPDYwoAHEEtcHEhBNWHMURtH Eg6g== 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=cckI8TzzI9h0pCxlvdtQ9ZkM+PSEdfqZ2zz4bNJ07Kc=; b=DaS0F0Mkcl629XiEKHE66mrhw0NT11oIbpkwfi0Fpy4U5/2D65upiSBrL0SCX9i2US y0HQ4OpCa6Ov31Mg4RS6PyH7CrxaWUAHalJ9XbwZAseM3doRbO3EzqBSj8p/uIsgC6cA yGeeU1I4GFoXRaLbt3DdjQEzWwOCTrUQbd3ZFtHs7BGCFVxmMeFmx7FZx7GwNbDVJ0bs 57XBfKdITR5wjC2hRX/YUiXbMTkloDSj8ruZyz+f5bRRyZXbEoLBTRcjSvLMJ+YoXQmo QckNr/szU2dHe/N4GfBRksQgawau6kUZnX3n8fE3x8BqxKiDiLq03D+7W7l/BftP47r5 W2oQ== X-Gm-Message-State: AOAM531cHsJc2yxqRAOtrFdkqMH/Y7BLNTDV9WdGSFA2mpGd+eaP+BEM nvElx+RT64ejiPOq8UWIVCGWlwKkZPRBSs5Yb/E= X-Received: by 2002:a05:6402:3076:: with SMTP id bs22mr340943edb.267.1606154734055; Mon, 23 Nov 2020 10:05:34 -0800 (PST) MIME-Version: 1.0 References: <20201113190851.7817-1-olga.kornievskaia@gmail.com> <99874775-A18C-4832-A2F0-F2152BE5CE32@oracle.com> <07AF9A5C-BC42-4F66-A153-19A410D312E1@oracle.com> <7E0CD3F3-84F2-4D08-8D5A-37AA0FA4852D@oracle.com> <20201119232647.GA11369@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> <20201123173802.GA26158@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> In-Reply-To: <20201123173802.GA26158@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com> From: Olga Kornievskaia Date: Mon, 23 Nov 2020 13:05:22 -0500 Message-ID: Subject: Re: [PATCH 1/1] NFSv4.2: fix LISTXATTR buffer receive size To: Frank van der Linden Cc: Chuck Lever , Trond Myklebust , Anna Schumaker , Linux NFS Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Nov 23, 2020 at 12:42 PM Frank van der Linden wrote: > > On Mon, Nov 23, 2020 at 11:42:46AM -0500, Olga Kornievskaia wrote: > > Hi Frank, Chuck, > > > > I would like your option on how LISTXATTR is supposed to work over > > RDMA. Here's my current understanding of why the listxattr is not > > working over the RDMA. > > > > This happens when the listxattr is called with a very small buffer > > size which RDMA wants to send an inline request. I really dont > > understand why, Chuck, you are not seeing any problems with hardware > > as far as I can tell it would have the same problem because the inline > > threshold size would still make this size inline. > > rcprdma_inline_fixup() is trying to write to pages that don't exist. > > > > When LISTXATTR sets this flag XDRBUF_SPARSE_PAGES there is code that > > will allocate pages in xs_alloc_sparse_pages() but this is ONLY for > > TCP. RDMA doesn't have anything like that. > > > > Question: Should there be code added to RDMA that will do something > > similar when it sees that flag set? Or, should LISTXATTR be re-written > > to be like READDIR which allocates pages before calling the code. > > Hm.. so if the flag never worked for RDMA, was NFS_V3_ACL ever tested > over RDMA? That's the only other user. It could have worked depending on whether or not ACL ever were sent inline. As I said LISTXATTR works when userspace provides a large buffer because that triggers the RDMA code to setup a reply chunk which allocated memory. So it's very specific case. It might have worked for ACL because the way ACL works (at least now) is that it's called first with a large buffer size, then client code actually caches the reply so when teh user space calls it again with appropriate buffer size, the code doesn't do another request. LISTXATTR doesn't have that optimization and it does another call. This way it uses a inline RDMA message which doesnt not work for when pages are not allocated as far as I can tell. > If the flag simply doesn't work, I agree that it should either be fixed > or just removed. > > It wouldn't be the end of the world to change LISTXATTRS (and GETXATTR) > to use preallocated pages. But, I didn't do that because I didn't want to > waste the max size (64k) every time, even though you usually just get > a few hundred bytes at most. So it seems like fixing XDRBUF_SPARSE_PAGES > is cleaner. > > - Frank