Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3691222ybb; Tue, 31 Mar 2020 10:04:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvklP9K0XFCwbIEVlc10iEcMxzcCWnjfSbzIlkhShnKUWtVCC12yQVverlTjPSCbgvoX4ps X-Received: by 2002:a05:6808:2d9:: with SMTP id a25mr2807567oid.125.1585674245584; Tue, 31 Mar 2020 10:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585674245; cv=none; d=google.com; s=arc-20160816; b=fyadsGKWOPCRGwtqmOu8E009lhjlUUkiBxpQZspNF+he/+BDRiBHFUiv72v11gtZUd bY0uACFqv4IS82rpo4VvWzguInqN7pJQ69/smr/vgiZwtPbRGHCu0CHcHWcDlxLsQMLQ r7i5VBcyJSlRDKhvOSj+/EYWCZHyvMxn3+sgKK22RMVuYw9Wu+zV1O5mmQmjRGWVxvsq gNgGj+HsIP+CL0tpS3Iaz21ztuzNnPVQZsLEm0lK3dELNjka1cKF1+aQ/D9d8MwvZO7Z 7gDdUowIMcH/ytQFFt2q1ENTDW671znOm1r4Mg9NSV7j0xWsnDh6fOow+hD0oic96QUK qBOg== 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:date:from:dkim-signature; bh=2HZuGdxB+x0mWlELwgsKVlrZ7g66xEPOmCIgcev6cRk=; b=AtU0nfrK2JLBWx+CwA6KetWghYxIcJkuXRuVvNrSyYrwRImWeujAHdvigOjspIFWTO +eln141AfVz2vOID4qKIlZxgJC8KEgTBOvvoyBa2r6QvCj5mnTklHnIMe1j8yWoL4xE+ chwhTon+EA8Gvl0balRu7NhC3HCoK8jW4aQggnBuK5TpJlKmQQeHqB/NgSV0gVOB6Cxa ek+7eyNSSrk6IST6fKF+PO/vwmu8DfGQW2DgxXQ1faW3qcDk5mkgXoNz9xxfEk9VYhVl YKCHDKFwY1mfpM73aVu2vG8IAgnKrqpg63RNddWXrWvY5z58Ueamr9uQJm9Zc3sfdHp/ 1VXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="saDy0un/"; 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 x14si7697058ooc.26.2020.03.31.10.03.50; Tue, 31 Mar 2020 10:04:05 -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="saDy0un/"; 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 S1731360AbgCaRCp (ORCPT + 99 others); Tue, 31 Mar 2020 13:02:45 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36143 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731353AbgCaRCn (ORCPT ); Tue, 31 Mar 2020 13:02:43 -0400 Received: by mail-lj1-f194.google.com with SMTP id b1so2217714ljp.3; Tue, 31 Mar 2020 10:02:42 -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=2HZuGdxB+x0mWlELwgsKVlrZ7g66xEPOmCIgcev6cRk=; b=saDy0un/8sSw+q2znKEJCS5QDo1c/iC0dk11oKl+JOJfL4CehAZVMFFlcyu621sIuI TpW5C06zUV0WDCr/X9/mUTfAfTpcbjqBE98ukvR//mgALXjLvwcWhUmG2yPendEbBJeV C2jkfOTrcwrRfyZ9iEiFsTuZ2QY96LLf+hh6QBBR9ZpFP7dmieBaOthVuOTi/2jyDm6O EZX8gF8J1mFOVjktbw6zMgj7Y6WLKLvliXqkQNGs41Huv7GbNswxobuCSn0G7n1CuMKw aYizYm0bVR0VwwbhMRNHf2+N0ignpgtMJyOrgwLV7A5lXZAaYxj+WVQfuxUMQYe9QoQt rpGA== 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=2HZuGdxB+x0mWlELwgsKVlrZ7g66xEPOmCIgcev6cRk=; b=PR8Si+77WR/Ub1CBVRloO1D1i44Fo6xTFkE3f2siHUJ21nKMOuqHdsABS4msq8L0ql VNTZQ54Gs9T6N1CenhbQjRoygssyFjybwretPhSAy8TgaTC3GlMRnIB3y+T2+X5jkGDP twYi3tDY1E9oUGXs0ukkEBuQhD2PBwr5XkO9ZpAo28a/o2rXaSxJX+ROiOoGX+qKUh6W BQOygen1ynBfTKdY0T86F5BYbTgZXtAWYybJ7CQvVR1EjZrxOLcBtm8SGtXARekXWdxW ikqiwyRrWDrexFxn4ZKgr5jYhF99ioxFuhtH1mGpohPLaSYxTispCvNfEaGOcg3nVu2x KnYg== X-Gm-Message-State: AGi0PuYk8L3dnAR4m215rUxUnE4zKIhAwEQb3MpMbsxm95jd+hOJogxH lF94tf+XpHW2O7icJCCepcs= X-Received: by 2002:a2e:3a19:: with SMTP id h25mr1985208lja.133.1585674160923; Tue, 31 Mar 2020 10:02:40 -0700 (PDT) Received: from pc636 (h5ef52e31.seluork.dyn.perspektivbredband.net. [94.245.46.49]) by smtp.gmail.com with ESMTPSA id 195sm6845074lfi.75.2020.03.31.10.02.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 10:02:40 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Tue, 31 Mar 2020 19:02:32 +0200 To: Uladzislau Rezki , "Paul E. McKenney" Cc: Joel Fernandes , linux-kernel@vger.kernel.org, linux-mm@kvack.org, rcu@vger.kernel.org, willy@infradead.org, peterz@infradead.org, neilb@suse.com, vbabka@suse.cz, mgorman@suse.de, Andrew Morton , Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , "Paul E. McKenney" , Steven Rostedt Subject: Re: [PATCH RFC] rcu/tree: Use GFP_MEMALLOC for alloc memory to free memory pattern Message-ID: <20200331170232.GA28413@pc636> References: <20200331131628.153118-1-joel@joelfernandes.org> <20200331140433.GA26498@pc636> <20200331150911.GC236678@google.com> <20200331160119.GA27614@pc636> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200331160119.GA27614@pc636> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > Paul was concerned about following scenario with hitting synchronize_rcu(): > > 1. Consider a system under memory pressure. > > 2. Consider some other subsystem X depending on another system Y which uses > > kfree_rcu(). If Y doesn't complete the operation in time, X accumulates > > more memory. > > 3. Since kfree_rcu() on Y hits synchronize_rcu() a lot, it slows it down. > > This causes X to further allocate memory, further causing a chain > > reaction. > > Paul, please correct me if I'm wrong. > > > I see your point and agree that in theory it can happen. So, we should > make it more tight when it comes to rcu_head attachment logic. > Just adding more thoughts about such concern. Even though in theory we can run into something like that. But also please note, that under high memory pressure it also does not mean that (X) will always succeed with further infinite allocations, so memory pressure is something common. As soon as the situation becomes slightly better we do our work much efficient. Practically, i was trying to simulate memory pressure to hit synchronize_rcu() on my test system. By just simulating head-less freeing(for any object) and by always dynamic attaching path. So i could trigger it, but that was really hard to achieve and it happened only few times. So that was not like a constant hit. What i got constantly were: - System got recovered and proceed with "normal" path; - The OOM hit as a final step, when the system is run out of memory fully. So, practically i have not seen massive synchronize_rcu() hit. -- Vlad Rezki