From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751978Ab0CQBoL (ORCPT ); Tue, 16 Mar 2010 21:44:11 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:41084 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751599Ab0CQBoK (ORCPT ); Tue, 16 Mar 2010 21:44:10 -0400 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: Mel Gorman Subject: Re: [PATCH 01/11] mm,migration: Take a reference to the anon_vma before migrating Cc: kosaki.motohiro@jp.fujitsu.com, Andrew Morton , Andrea Arcangeli , Christoph Lameter , Adam Litke , Avi Kivity , David Rientjes , Rik van Riel , linux-kernel@vger.kernel.org, linux-mm@kvack.org In-Reply-To: <1268412087-13536-2-git-send-email-mel@csn.ul.ie> References: <1268412087-13536-1-git-send-email-mel@csn.ul.ie> <1268412087-13536-2-git-send-email-mel@csn.ul.ie> Message-Id: <20100317103434.4C8B.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Wed, 17 Mar 2010 10:44:06 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > rcu_unlock: > + > + /* Drop an anon_vma reference if we took one */ > + if (anon_vma && atomic_dec_and_lock(&anon_vma->migrate_refcount, &anon_vma->lock)) { > + int empty = list_empty(&anon_vma->head); > + spin_unlock(&anon_vma->lock); > + if (empty) > + anon_vma_free(anon_vma); > + } > + Why don't we check ksm_refcount here? Also, why drop_anon_vma() doesn't need check migrate_refcount? plus, if we add this logic, we can remove SLAB_DESTROY_BY_RCU from anon_vma_cachep and rcu_read_lock() from unmap_and_move(), I think. It is for preventing anon_vma recycle logic. but no free directly mean no memory recycle. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail190.messagelabs.com (mail190.messagelabs.com [216.82.249.51]) by kanga.kvack.org (Postfix) with SMTP id 14C016B0087 for ; Tue, 16 Mar 2010 21:44:09 -0400 (EDT) Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o2H1i86J009645 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Wed, 17 Mar 2010 10:44:08 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 776F345DE4D for ; Wed, 17 Mar 2010 10:44:08 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 4B6CD45DE4E for ; Wed, 17 Mar 2010 10:44:08 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 0FB36E38006 for ; Wed, 17 Mar 2010 10:44:08 +0900 (JST) Received: from m107.s.css.fujitsu.com (m107.s.css.fujitsu.com [10.249.87.107]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id C276DE38002 for ; Wed, 17 Mar 2010 10:44:07 +0900 (JST) From: KOSAKI Motohiro Subject: Re: [PATCH 01/11] mm,migration: Take a reference to the anon_vma before migrating In-Reply-To: <1268412087-13536-2-git-send-email-mel@csn.ul.ie> References: <1268412087-13536-1-git-send-email-mel@csn.ul.ie> <1268412087-13536-2-git-send-email-mel@csn.ul.ie> Message-Id: <20100317103434.4C8B.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Wed, 17 Mar 2010 10:44:06 +0900 (JST) Sender: owner-linux-mm@kvack.org To: Mel Gorman Cc: kosaki.motohiro@jp.fujitsu.com, Andrew Morton , Andrea Arcangeli , Christoph Lameter , Adam Litke , Avi Kivity , David Rientjes , Rik van Riel , linux-kernel@vger.kernel.org, linux-mm@kvack.org List-ID: > rcu_unlock: > + > + /* Drop an anon_vma reference if we took one */ > + if (anon_vma && atomic_dec_and_lock(&anon_vma->migrate_refcount, &anon_vma->lock)) { > + int empty = list_empty(&anon_vma->head); > + spin_unlock(&anon_vma->lock); > + if (empty) > + anon_vma_free(anon_vma); > + } > + Why don't we check ksm_refcount here? Also, why drop_anon_vma() doesn't need check migrate_refcount? plus, if we add this logic, we can remove SLAB_DESTROY_BY_RCU from anon_vma_cachep and rcu_read_lock() from unmap_and_move(), I think. It is for preventing anon_vma recycle logic. but no free directly mean no memory recycle. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org