Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp734724pxb; Tue, 3 Nov 2020 11:02:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4+9F6s5WpOBr1IKqmVtNdJRhFSuF6MCnd0r4JoJTTwGlQksWgd1fvMPAaX3QyOjnTgHJv X-Received: by 2002:a50:bf41:: with SMTP id g1mr3708865edk.165.1604430178609; Tue, 03 Nov 2020 11:02:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604430178; cv=none; d=google.com; s=arc-20160816; b=OU/eYsyvMRInNkRVi3Wmc2qSyJARViu3K1u3ZWo9QT/2qtgnkIG2yAh5E0y1zlAJnz 1m0JzCuHtDw03yFo7MTpHfabHXQDZq+w/h+vp6QMEZHbThhFmrRz0H9NLnmg71TxUk/D IWFyExWJdjryrJh5tLGaPVcoLhUbveltlKIEDf8K6cRDUDNa2p/7YsgR+gQ3vClpeuDV Ep0xDu6yDHILQhRHmnsFFrLG5od0Tm+bjL9QWSTBuk3aoGcK/WzjxAv407Eaw+ZEbD2l YrdvqxfgHgumzecndiFL+gBH4GlBRBPZI7DVU2JH1tej8M2Yyw4CosX/3H7vB2Nqzlxd pcww== 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=Yyz56LcDgE7MQ3P04W5uenRAxGknrqGGYLnUXqlXhlc=; b=CTK6T2EIuPRCsddfLd3IAxHFoOMmC9zWgu5gP2nfjsKs4p1xth0vUq3cjqwfG3LdNJ 26FybwfiRmZ8iDu2oaX9FJSqnbaTvySdXAf3c4BCwIzUWk1ac1O+J1F/TqOX3JZpNBDr MQ/+Y3zMl2cRiRsQfG2mvfzkWExHB4dzK7XLtbr6yvR+o5h3/LPopHziOiBk+W6eZzVC c1TF2P5ksweZCov+kkPAT4qLFnbcGrCGltEN86IA5aPAzMBgde0+9DRaT73JQx4oX7Ao OJH5fdfAFO73Q3gr9q47P8hyL8R78FxJa8sz7FqAdjzUncbQ0roMtrM8+e6VSYdL7lxH jtwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OtsGcoUD; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si17127527edk.526.2020.11.03.11.02.35; Tue, 03 Nov 2020 11:02:58 -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=@chromium.org header.s=google header.b=OtsGcoUD; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729429AbgKCS7V (ORCPT + 99 others); Tue, 3 Nov 2020 13:59:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbgKCS7U (ORCPT ); Tue, 3 Nov 2020 13:59:20 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EE70C0613D1 for ; Tue, 3 Nov 2020 10:59:20 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id a7so23636819lfk.9 for ; Tue, 03 Nov 2020 10:59:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yyz56LcDgE7MQ3P04W5uenRAxGknrqGGYLnUXqlXhlc=; b=OtsGcoUDGZrMZFYe0h9FmnR27BjPtYKNbzVr5SK58kdl/KCOM7OXW/ORkfWFkSG/a1 gKqaqdvofNdsCPg+TMabv/xetMpSCObEnkjatwOBfdRZUFD7qNHPEvWgpsHHgoWKV3vS fHMcVijigA1xn50yT2L8FNPDm9EhxPXU4C8/4= 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=Yyz56LcDgE7MQ3P04W5uenRAxGknrqGGYLnUXqlXhlc=; b=TSUcNXiXLiONkTwh5CAZw1ruoKrnCggKm4sTiSQo6x1+WkKpJjMa7bzC9HZEl9xx8d /ET4/In0jKaoLvOPPlI1P02q/gDsXVsswDFU/9EyxickQ3uj84UuS5lWvYclVy9Chx1E EBhzKHsKQWt+tx9whjv/r5Y+VJCUMDOqlBeuD0vvO1G8ZEuyNHz8X8pLtmDZbbrApqH3 fIlfIlIhNLq0+A8C8apddFuYzar9SLOy3aONs7Emd529Un70rr5nMj/EaoF2/EBK6xkT JQ9LtVOo6GIteLRpCT5SxTAPZPQ2ZR68xkB/ekC1KGaRfqayDH8R1RWsBtrUMLLUWjVl bbaA== X-Gm-Message-State: AOAM530IYxCHHpVq1nI2xLLy888N9tTnYjGCsstJkGFeXZpQrmCx2opQ h8mb3wYYzBlac2FjI/avzbWUCFO3EDedQlaVZEWONQ== X-Received: by 2002:a19:c80a:: with SMTP id y10mr8993128lff.329.1604429959075; Tue, 03 Nov 2020 10:59:19 -0800 (PST) MIME-Version: 1.0 References: <20201103153132.2717326-1-kpsingh@chromium.org> <20201103153132.2717326-8-kpsingh@chromium.org> <20201103184714.iukuqfw2byls3s4k@ast-mbp.dhcp.thefacebook.com> In-Reply-To: <20201103184714.iukuqfw2byls3s4k@ast-mbp.dhcp.thefacebook.com> From: KP Singh Date: Tue, 3 Nov 2020 19:59:08 +0100 Message-ID: Subject: Re: [PATCH bpf-next v2 7/8] bpf: Add tests for task_local_storage To: Alexei Starovoitov Cc: open list , bpf , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Paul Turner , Jann Horn , Hao Luo Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 3, 2020 at 7:47 PM Alexei Starovoitov wrote: > > On Tue, Nov 03, 2020 at 04:31:31PM +0100, KP Singh wrote: > > + > > +struct storage { > > + void *inode; > > + unsigned int value; > > + /* Lock ensures that spin locked versions of local stoage operations > > + * also work, most operations in this tests are still single threaded > > + */ > > + struct bpf_spin_lock lock; > > +}; > > I think it's a good idea to test spin_lock in local_storage, > but it seems the test is not doing it fully. > It's only adding it to the storage, but the program is not accessing it. I added it here just to check if the offset calculations (map->spin_lock_off) are correctly happening for these new maps. As mentioned in the updates, I do intend to generalize tools/testing/selftests/bpf/map_tests/sk_storage_map.c which already has the threading logic to exercise bpf_spin_lock in storage maps. Hope this is an okay plan?