From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFCA5143725; Thu, 3 Oct 2024 09:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727946834; cv=none; b=Vhb+DVSNZnpjuL1a+7uD8089/WH35RcgALBBxVDJ7LF/QAJEixPECieha96xWzRc8rCrELvFigYirj5myvn62az4X5qwBBLS2XGTlELQcOHCnSHFcQknK5krdZ6y5gOHCrZeNR/vwq6Mj4OJAQDV0I+pxxM8Jo4RLTZZsmhaSMM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727946834; c=relaxed/simple; bh=ycpdvLNhz+R+FpxfbMcMNSiEkjPDEsZjLMjIcym0XAE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fnUX1GRR9IIGnCanGCzqclEGyW04SeXoPwFwnclR22gUxHvOWLog06apLq0fKuuRiohmo3lKccLHPqJoLl5fqmaxuaYCahawRn9ctnREre7n/emya7wE0OADux/zeL7i4unirU3tbI2GMuROoP5GJq5qZNXR/l0ayjY6v9bqwwU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YGfsAtH1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YGfsAtH1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0117C4CEC7; Thu, 3 Oct 2024 09:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727946833; bh=ycpdvLNhz+R+FpxfbMcMNSiEkjPDEsZjLMjIcym0XAE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YGfsAtH1SaRWz5ZO2owf+AkYYxzeP93z2XE/fSNKttVgS945LQ7hxEThQWjVAeD3k Q82S3BBNOiKQZwJf4H2+dK8Vi8mnOORfNPUEZ/NYDaEtpqdgkR4myBymvWubCyOOw2 t4Lg95AkpnFMhCBAh1rzy2u5MbB5XHpWuioxe/X6/HXwAz+jDD6jefLa004wOgcUvl PqBgJp/xai9T7pDgapyEkyAsZ5sXdijOwTIcXjPeEPYI2vnNbUkmAb/AZ9kC0Zl2W9 fmHT5gNeXSqlDvAtmnLM9itByKMehuMunzfOsaXHx9lkQYCI7LWryRdT9Af13fONCz BVSraE1KkCSmA== Date: Thu, 3 Oct 2024 11:13:46 +0200 From: Christian Brauner To: Andrii Nakryiko Cc: linux-trace-kernel@vger.kernel.org, peterz@infradead.org, oleg@redhat.com, rostedt@goodmis.org, mhiramat@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org, paulmck@kernel.org, willy@infradead.org, surenb@google.com, akpm@linux-foundation.org, linux-mm@kvack.org, mjguzik@gmail.com, jannh@google.com, mhocko@kernel.org, vbabka@suse.cz, mingo@kernel.org, Amir Goldstein Subject: Re: [PATCH v2 tip/perf/core 3/5] fs: add back RCU-delayed freeing of FMODE_BACKING file Message-ID: <20241003-lachs-handel-4f3a9f31403d@brauner> References: <20241001225207.2215639-1-andrii@kernel.org> <20241001225207.2215639-4-andrii@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20241001225207.2215639-4-andrii@kernel.org> On Tue, Oct 01, 2024 at 03:52:05PM GMT, Andrii Nakryiko wrote: > 6cf41fcfe099 ("backing file: free directly") switched FMODE_BACKING > files to direct freeing as back then there were no use cases requiring > RCU protected access to such files. > > Now, with speculative lockless VMA-to-uprobe lookup logic, we do need to > have a guarantee that struct file memory is not going to be freed from > under us during speculative check. So add back RCU-delayed freeing > logic. > > We use headless kfree_rcu_mightsleep() variant, as file_free() is only > called for FMODE_BACKING files in might_sleep() context. > > Suggested-by: Suren Baghdasaryan > Cc: Christian Brauner > Cc: Amir Goldstein > Signed-off-by: Andrii Nakryiko > --- Reviewed-by: Christian Brauner