Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1700881imm; Thu, 16 Aug 2018 00:45:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw+r6BYwvpc642vO66PY4M1LidCO1p7iWSRFOPmG55x6+oTk+zFAVN/LBAS644WewWL/tpq X-Received: by 2002:a17:902:b609:: with SMTP id b9-v6mr4767495pls.321.1534405522671; Thu, 16 Aug 2018 00:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534405522; cv=none; d=google.com; s=arc-20160816; b=WBaX1T8VjgBp4hhG2PzRDIEB726DMzefxP+UY3m4wsh1frfhoIK7vu8/kCFruM8iy7 yepO0OVGKQ37glB6jcCNRqttM/ABM7obcds4DR0yCJtd6M1TulfZYY3LimKxenVpptWR 1m7VecUnm+OMIlq/yezaUUbI2/HWkTA7txMM0R0l6zeQsiFdirO86uJGBlXy4cCIMHmI JX/ZIJlfc41V1l9Ux6xrrrFZRQl4xNAHoDy7CuUiHQWL0nLscg4//mxyfPKqkNoZA4lf csXGTDV55r9oF6d+Cw3Le1syEPgHCcOGkHPMsl+GpRIMoakJU4OrI3Lgr7kbeSdJTvu4 WFOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Xc6yhhUfXTvJs3e1KNnqtBfZ+6DQtygjHrIODwlucIw=; b=AMC0SXy8cN/i3nqJjj6GYiLQjS/FAf9GzHG10Wza/K4OUzqd0usIrAMeySQIGLDLo7 DsH1wVQ8Cp4hUCXGOXYVThwlwKEI6akQUcyAnKlMGfW2DPTUgZFqm8c0By1ZCKxmFyFa RG6eWuZTWJKe7Iwbpje4rStnRZ7fhM/l4x7VHF0nK/lck7GAecfTXO4jgqzVZ4hSwmdp iEvrebBX5xYPXyamA9ny9KBVefXOdGC/Z1WgszZmWq4gjth0ejQrFOUSLgtD6rtlZ42X Gu2W3tlwa6lxn72w6Ly+nsZ0m5kZVhFHz+hya9NB/rR63GbRLf2nw34ZkXc9orYYIa0S gEQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I17wE5rJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id h65-v6si29133418pfb.70.2018.08.16.00.45.08; Thu, 16 Aug 2018 00:45:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I17wE5rJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S2387744AbeHPG5U (ORCPT + 99 others); Thu, 16 Aug 2018 02:57:20 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:38820 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728094AbeHPG5U (ORCPT ); Thu, 16 Aug 2018 02:57:20 -0400 Received: by mail-pf1-f196.google.com with SMTP id x17-v6so1398680pfh.5; Wed, 15 Aug 2018 21:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Xc6yhhUfXTvJs3e1KNnqtBfZ+6DQtygjHrIODwlucIw=; b=I17wE5rJvFqsKi2l/kYTTAWRVQ5sDD1raY17KlK/Miq0n3EbHZ+VmZZpO0IAWHkyCt 8D0NV5r8d+eVfkQ3D9ETc20wSRLIO6ynIxxG2/PBxP+5FNl6RuKjqI/zTOMrKy/13Fri d7WoTmDFf0SuyYAVJ5gg7wNvQBvDnN3d8dUD5uiZsza5BKEH1+C1TCArOEFrm+QWJZ8D BJPmt8JxaqcOKqXz7LHtBfhSA65KYBCqKD1gcMa1ibaKRthr/L7pz2Av801MywYplCwj Wpn0rcei9Tt6LXPD6RyjH0kxzfcGdZTsTL/7zsZytxPZda/mC/d4jFtiU/KUsaeLct8J WhWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Xc6yhhUfXTvJs3e1KNnqtBfZ+6DQtygjHrIODwlucIw=; b=ZD/wIMjmskJh36oCj4aagHZq2zKZiR8yXByHvwj815b6UFZPOy755xWbKUrqNUh8L7 if83ocxcGiK5r2HMVp914H7rMRSRexSXCATc9Vls15fGqQ/SS9qlAAi6aVGeYZ3j19xU Jp+v30sUCCOdyM2EAxBJ5KzSNhqIuQIC/Pl/vXil4mwehN0TfJIeGpejJmIeLWjZhy7U u+pAbmnokC44Pdwo9T6ZjiWa8INAnxrwUoeUMCXiRTZSEzZQPpN3tsFxVBh/m3Mqz5pr Ocxk65wMkElH3BavrZfv4MNdurfxz0oY2YHycguvFOgRSFCMJkKzubToMYvQsvDQdtfa /W9g== X-Gm-Message-State: AOUpUlEeYJAcVnLlXFuZWLBCMWRFQu/noBwztskqM/X2v7PGu+I03wZD zEx0VZVA1zpHlSbh1SniE/edtsaH X-Received: by 2002:a62:3545:: with SMTP id c66-v6mr30488327pfa.63.1534392109824; Wed, 15 Aug 2018 21:01:49 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:180::1:97de]) by smtp.gmail.com with ESMTPSA id r23-v6sm73398938pfd.144.2018.08.15.21.01.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 21:01:48 -0700 (PDT) Date: Wed, 15 Aug 2018 21:01:47 -0700 From: Alexei Starovoitov To: Daniel Colascione Cc: Daniel Borkmann , Jakub Kicinski , Joel Fernandes , linux-kernel , Tim Murray , netdev , Lorenzo Colitti , Chenbo Feng , Mathieu Desnoyers , Alexei Starovoitov Subject: Re: [PATCH v3] Add BPF_SYNCHRONIZE_MAP_TO_MAP_REFERENCES bpf(2) command Message-ID: <20180816040145.gqzqicab4s6kcbye@ast-mbp.dhcp.thefacebook.com> References: <20180729205835.34850-1-dancol@google.com> <20180730172641.7d516231@cakuba.netronome.com> <67423232-be56-fd47-06e6-394812c2b918@iogearbox.net> <20180810225246.3d3pa5qvbtoh42bt@ast-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 14, 2018 at 01:37:12PM -0700, Daniel Colascione wrote: > > > If we agree on that, should bpf_map_update handle it then? > > Wouldn't it be much easier to understand and use from user pov? > > No new commands to learn. map_update syscall replaced the map > > and old map is no longer accessed by the program via this given map-in-map. > > Maybe with a new BPF_SYNCHRONIZE flag for BPF_MAP_UPDATE_ELEM and > BPF_MAP_DELETE_ELEM. Otherwise, it seems wrong to make every user of > these commands pay for synchronization that only a few will need. I don't think extra flag is needed. Extra sync_rcu() for map-in-map is useful for all users. I would consider it a bugfix, since users that examine deleted map have this race today and removing the race is always a good thing especially since the cost is small.