Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp562046ima; Fri, 26 Oct 2018 02:59:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5e1VW8OkcMBV0JNswp6xC29py1VqVf0IRkwQeU1QayiIesgx6lz6p2s2gv8sosVJkDXYFd9 X-Received: by 2002:a63:ef0b:: with SMTP id u11-v6mr2823195pgh.283.1540547945935; Fri, 26 Oct 2018 02:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540547945; cv=none; d=google.com; s=arc-20160816; b=wf3jjpLVImObHMl5kjUYxQ+DY7q3XyUrj7LxPPVHS2uA/Oa2s49ZSF0anN6QDtwtn+ DgYv116Ya9VyL9DvaQkvyvsFD/10rEqV+wbJpUWdniuQj//aor/qRCydm5a9TjYTMoFy htnoEopr7wANlkgbZCdb37PB4QqzDj+DuCjSzZ8Xp3+rz41m2OUkNnbCt1THHx6vHWYz hDEqmRy2/DGpVbSEKNuZ9wfXKUq+OH7NwMucncYQ9AiokpN5MIalL01/EzbqbkOtd647 UtE1lKOt213Ah9rrdRGmr/OuCvuL93W52hDVQNIG5swIzdhjP/sqvPd/T8hpuMOVC5mX kt1w== 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; bh=7xgOBhIV84R3NpYql/jkh1mbbx8m+kry9kTYf0pKJ4Q=; b=ACYzuoRHYDvnmmkJvia7ereThO8AzxPvR55bH5BQVbgMhvXJr2/O9jESE6HDdz8HgF 3NfcyFUlgm03mr9fPr+fL3MDosQ09kyeO15YafOv8QSMYG24viACI0gu+Wq8fKSHGJ2c AS1EAfKyvVSipQtT94kezTEzobKEbVmINKGx/AbidsxI9tD/Wd7Xemcjz4oNaPbeR6qC 893xSjXVki/sChfaoNfop1FMva/7ymsleJwCxcWm0F1kuat462NOLTQwIK+3H6ol8+B3 Pwuq11164bDhtg+x0DupNG+Bh1w132xvjoeph24JY1LhiI/HjRVaYenY+pTgcoJuEz01 Ry8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=tWrEqNJ+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19-v6si10321331plz.16.2018.10.26.02.58.50; Fri, 26 Oct 2018 02:59: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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=tWrEqNJ+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727291AbeJZSdQ (ORCPT + 99 others); Fri, 26 Oct 2018 14:33:16 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33250 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbeJZSdP (ORCPT ); Fri, 26 Oct 2018 14:33:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7xgOBhIV84R3NpYql/jkh1mbbx8m+kry9kTYf0pKJ4Q=; b=tWrEqNJ+UI1qQvK1coEIG27bZ lWi0ep0c8oURa7uP0nZ95XzDiEjL+KFLVHZPhNXb70m58UMqKitVtmilaYjYm7gBVlkHVV4Sruirb h2fnbJO2BXL8LUj07r+EyiVEyHpVWD5XuxmshFxlx6CfZV+B+lSGazyKV3rHzkT6G5Rcj94c5zINL tSx2KBo1iRMM8Xm8fkG/90AZjoNMZri4TZuW+7ekgpUyM0D1r2pDhmt+Gm5FLgmXpPUk57Vxnu1Px w4nHohYZK4h402lMFbL7EW+Ut+Ggjd43TZJe6bfyAiozmTzrgpUG+GQC0/xL0zt9M2gmyn4FPq4Dv f8E0B17kw==; Received: from [167.98.65.38] (helo=worktop) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFyqk-0001HE-V6; Fri, 26 Oct 2018 09:56:15 +0000 Received: by worktop (Postfix, from userid 1000) id CF15C6E07BE; Fri, 26 Oct 2018 11:38:04 +0200 (CEST) Date: Fri, 26 Oct 2018 11:38:04 +0200 From: Peter Zijlstra To: Igor Stoppa Cc: Mimi Zohar , Kees Cook , Matthew Wilcox , Dave Chinner , James Morris , Michal Hocko , kernel-hardening@lists.openwall.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, igor.stoppa@huawei.com, Dave Hansen , Jonathan Corbet , Laura Abbott , Thomas Gleixner , Kate Stewart , "David S. Miller" , Greg Kroah-Hartman , Philippe Ombredanne , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/17] prmem: llist, hlist, both plain and rcu Message-ID: <20181026093804.GD3126@worktop.c.hoisthospitality.com> References: <20181023213504.28905-1-igor.stoppa@huawei.com> <20181023213504.28905-15-igor.stoppa@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181023213504.28905-15-igor.stoppa@huawei.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 24, 2018 at 12:35:01AM +0300, Igor Stoppa wrote: > In some cases, all the data needing protection can be allocated from a pool > in one go, as directly writable, then initialized and protected. > The sequence is relatively short and it's acceptable to leave the entire > data set unprotected. > > In other cases, this is not possible, because the data will trickle over > a relatively long period of time, in a non predictable way, possibly for > the entire duration of the operations. > > For these cases, the safe approach is to have the memory already write > protected, when allocated. However, this will require replacing any > direct assignment with calls to functions that can perform write rare. > > Since lists are one of the most commonly used data structures in kernel, > they are a the first candidate for receiving write rare extensions. > > This patch implements basic functionality for altering said lists. > > Signed-off-by: Igor Stoppa > CC: Thomas Gleixner > CC: Kate Stewart > CC: "David S. Miller" > CC: Greg Kroah-Hartman > CC: Philippe Ombredanne > CC: "Paul E. McKenney" > CC: Josh Triplett > CC: Steven Rostedt > CC: Mathieu Desnoyers > CC: Lai Jiangshan > CC: linux-kernel@vger.kernel.org > --- > MAINTAINERS | 1 + > include/linux/prlist.h | 934 +++++++++++++++++++++++++++++++++++++++++ I'm not at all sure I understand the Changelog, or how it justifies duplicating almost 1k lines of code. Sure lists aren't the most complicated thing we have, but duplicating that much is still very _very_ bad form. Why are we doing this?