Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp405932pxk; Thu, 24 Sep 2020 08:25:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+xznLiWeis79W+hbGFq1EMGA8/s8kA7paJm5KTMMrrFih6ZZ8HljjRXwjm8Eyugm0R58Y X-Received: by 2002:a05:6402:84f:: with SMTP id b15mr427488edz.149.1600961106121; Thu, 24 Sep 2020 08:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600961106; cv=none; d=google.com; s=arc-20160816; b=K06186AjReHiQa9uHwmNlbRrebuMDk2XoYi1BvZZ37Fwkf2c791mAnycabsOGK7kO8 cuhuqNFxnm17MUqQwudyl/vsSARw4QxYAaAXtQyd9VkVFKhy2VWOzq6MiSIy4KeaO8B3 hEv5UjlU+ZZ4uO+EWWH8V3Tm7J+TF0L/7HgNJXwvyz5BlC/S6tOWe+IpsWjl72gKeDyP 8XPSbLBqhjyqXBNI3zHYhv+KghxZl2K2YTGXKYzfpogPU/G7xxuJn+5H53hhiaAeYPwn UogO1Ba7hOX/leL5gtnsVH4kNb5cHprQpnnIH27Uss9iBBg7zDWd+GkgXgEn4NP0/65W PHNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=U/mZAambhFcl0S7KGEMSUJjg0a7gPmj28sRt8xsxUs0=; b=JNGWHcENMPq9waie+HTNqtM1pLrwYncAlezMCTvbakfTY3Ir1+sRboPcaYLejtDrDi B/9lN9Ov7q17DIddY7PCNtUoQaURUlhLw6ionNE/sMbC20SKgt+3XuQlVblqninyZbNo QKwp62yN6owvcKXw3A0v8SWMLzUorW062P3lsrQH2E2C0+NHik9GZXkL3b7HVvPbJwL/ 7xDvi8Yq11MG3VkcSApTgoZ3N6J3ipKZe4hjAluBQvZaZZNL+7Fs+l0yD42FIvu+laR/ J7ThskGKdXeD7cQw5m3uA+D8J1i/9HtPfga4eypUOLHcYeIcpR55RhkQkJxySJ/DnLtt Pksw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B1cp87nP; 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=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 q23si2101727ejn.400.2020.09.24.08.24.41; Thu, 24 Sep 2020 08:25:06 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=B1cp87nP; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728435AbgIXPVR (ORCPT + 99 others); Thu, 24 Sep 2020 11:21:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728139AbgIXPVR (ORCPT ); Thu, 24 Sep 2020 11:21:17 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1495CC0613CE; Thu, 24 Sep 2020 08:21:17 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id s205so3078440lja.7; Thu, 24 Sep 2020 08:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=U/mZAambhFcl0S7KGEMSUJjg0a7gPmj28sRt8xsxUs0=; b=B1cp87nPpk6fcWkz7WopVAUa9cH5zagTJ8w6MstgYFm2N8S6/lERSognJMXCMS0C+9 mToxWz1aWOpujhsqR9EYGB9aw2XcIxz9xCDxeb2nb8zspvfNQZkW8Tp2I9cXqtzox+81 Lr4UL51TmMNrEX23ZWzFpDZgumqj8CIWk4F5y8ZygycgvfeL1OmX+TCmn3hA776svmx/ 04MwvEJGpkbZB+9hzLOATT6IWG9TzXVRVORodjxckIKf+WBADQ/6rwdW1rUFGzVsKLfy TIPf9pJcCBWthYpY4V4YL/Krj1doPvm+fSIvLsBzX4IyRdAb/7q3mafoL3d77UlWomb4 eRnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=U/mZAambhFcl0S7KGEMSUJjg0a7gPmj28sRt8xsxUs0=; b=l59+wlLPMtzF7L73hcur+Q//UBglKDl4eV6Kf4Eyj4+MHJooUUNiHqzEuDzRMBtpsI 3s9qFspbJN7AKY/ZGBAuNCLkvLd/9NJrqhOopVbie+NSly5dSmGsWi9Y/YGwrbL/Lvbu TLemxxPtnllvDgYslZz5tbakkYTlGBwPMdq54SMMtuPfO4JspUeJ2e1u8ikOPoLWJI1u ENY89ptPLKSmjzK/SLuhg2a5JcLCyiwMRyUt6H3Nl+UTNyql7pIX/4G3K424QV4dsyRA WtWeU8jW0PwUr7vvMmZDDnYg+4bS4g8iQgaBgVM+/70L8i5AIlGuuFp1092MZ8VrH9Kl mtyg== X-Gm-Message-State: AOAM533M6HTNiqytfCzEuNNe1o5IhlRVx0bG2DVJ1sIDfiRKaZDp1DdE YEKiDzz9h8UnzrFG4Icev7g= X-Received: by 2002:a2e:3008:: with SMTP id w8mr99644ljw.63.1600960875417; Thu, 24 Sep 2020 08:21:15 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id o128sm2313144lfa.110.2020.09.24.08.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 08:21:14 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 24 Sep 2020 17:21:12 +0200 To: Peter Zijlstra Cc: Uladzislau Rezki , Mel Gorman , "Paul E. McKenney" , Michal Hocko , LKML , RCU , linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Thomas Gleixner , "Theodore Y . Ts'o" , Joel Fernandes , Sebastian Andrzej Siewior , Oleksiy Avramchenko , Mel Gorman Subject: Re: [RFC-PATCH 2/4] mm: Add __rcu_alloc_page_lockless() func. Message-ID: <20200924152112.GB19013@pc636> References: <20200921154558.GD29330@paulmck-ThinkPad-P72> <20200921160318.GO12990@dhcp22.suse.cz> <20200921194819.GA24236@pc636> <20200922075002.GU12990@dhcp22.suse.cz> <20200922131257.GA29241@pc636> <20200923103706.GJ3179@techsingularity.net> <20200923154105.GO29330@paulmck-ThinkPad-P72> <20200923232251.GK3179@techsingularity.net> <20200924081614.GA14819@pc636> <20200924111907.GE2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924111907.GE2628@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 01:19:07PM +0200, Peter Zijlstra wrote: > On Thu, Sep 24, 2020 at 10:16:14AM +0200, Uladzislau Rezki wrote: > > The key point is "enough". We need pages to make a) fast progress b) support > > single argument of kvfree_rcu(one_arg). Not vice versa. That "enough" depends > > on scheduler latency and vague pre-allocated number of pages, it might > > be not enough what would require to refill it more and more or we can overshoot > > that would lead to memory overhead. So we have here timing issues and > > not accurate model. IMHO. > > I'm firmly opposed to the single argument kvfree_rcu() idea, that's > requiring memory to free memory. > Hmm.. The problem is there is a demand in it: Please have a look at places in the kernel where people do not embed the rcu_head into their stuctures and do like: synchronize_rcu(); kfree(p); urezki@pc638:~/data/coding/linux-rcu.git$ find ./ -name "*.c" | xargs grep -C 1 -rn "synchronize_rcu" | grep kfree ./fs/nfs/sysfs.c-113- kfree(old); ./fs/ext4/super.c-1708- kfree(old_qname); ./kernel/trace/ftrace.c-5079- kfree(direct); ./kernel/trace/ftrace.c-5156- kfree(direct); ./kernel/trace/trace_probe.c-1087- kfree(link); ./kernel/module.c-3910- kfree(mod->args); ./net/core/sysctl_net_core.c-143- kfree(cur); ./arch/x86/mm/mmio-mod.c-314- kfree(found_trace); ./drivers/mfd/dln2.c-183- kfree(i); ./drivers/block/drbd/drbd_state.c-2074- kfree(old_conf); ./drivers/block/drbd/drbd_nl.c-1689- kfree(old_disk_conf); ./drivers/block/drbd/drbd_nl.c-2522- kfree(old_net_conf); ./drivers/block/drbd/drbd_nl.c-2935- kfree(old_disk_conf); ./drivers/block/drbd/drbd_receiver.c-3805- kfree(old_net_conf); ./drivers/block/drbd/drbd_receiver.c-4177- kfree(old_disk_conf); ./drivers/ipack/carriers/tpci200.c-189- kfree(slot_irq); ./drivers/crypto/nx/nx-842-pseries.c-1010- kfree(old_devdata); ./drivers/net/ethernet/myricom/myri10ge/myri10ge.c-3583- kfree(mgp->ss); ./drivers/net/ethernet/mellanox/mlx5/core/fpga/tls.c:286: synchronize_rcu(); /* before kfree(flow) */ ./drivers/net/ethernet/mellanox/mlxsw/core.c-1574- kfree(rxl_item); ./drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c-6642- kfree(adapter->mbox_log); ./drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c-6644- kfree(adapter); ./drivers/infiniband/hw/hfi1/sdma.c-1337- kfree(dd->per_sdma); ./drivers/infiniband/core/device.c:2164: * synchronize_rcu before the netdev is kfreed, so we ./drivers/misc/vmw_vmci/vmci_context.c-692- kfree(notifier); ./drivers/misc/vmw_vmci/vmci_event.c-213- kfree(s); ./drivers/staging/fwserial/fwserial.c-2122- kfree(peer); urezki@pc638:~/data/coding/linux-rcu.git$ -- Vlad Rezki