Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760401AbcLPJ45 (ORCPT ); Fri, 16 Dec 2016 04:56:57 -0500 Received: from merlin.infradead.org ([205.233.59.134]:45956 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759670AbcLPJ4n (ORCPT ); Fri, 16 Dec 2016 04:56:43 -0500 Date: Fri, 16 Dec 2016 10:56:24 +0100 From: Peter Zijlstra To: Vegard Nossum Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Rik van Riel , Matthew Wilcox , Andrew Morton , Michal Hocko , Al Viro , Ingo Molnar , Linus Torvalds Subject: Re: [PATCH 1/4] mm: add new mmgrab() helper Message-ID: <20161216095624.GR3107@twins.programming.kicks-ass.net> References: <20161216082202.21044-1-vegard.nossum@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161216082202.21044-1-vegard.nossum@oracle.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 724 Lines: 16 On Fri, Dec 16, 2016 at 09:21:59AM +0100, Vegard Nossum wrote: > Apart from adding the helper function itself, the rest of the kernel is > converted mechanically using: > > git grep -l 'atomic_inc.*mm_count' | xargs sed -i 's/atomic_inc(&\(.*\)->mm_count);/mmgrab\(\1\);/' > git grep -l 'atomic_inc.*mm_count' | xargs sed -i 's/atomic_inc(&\(.*\)\.mm_count);/mmgrab\(\&\1\);/' > > This is needed for a later patch that hooks into the helper, but might be > a worthwhile cleanup on its own. Given the desire to replace all refcounting with a specific refcount type, this seems to make sense. FYI: http://www.openwall.com/lists/kernel-hardening/2016/12/07/8 But I must say mmget() vs mmgrab() is a wee bit confusing.