All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
	Michal Hocko <mhocko@suse.cz>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Hugh Dickins <hughd@google.com>,
	Davidlohr Bueso <davidlohr.bueso@hp.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Joonsoo Kim <js1304@gmail.com>,
	Wanpeng Li <liwanp@linux.vnet.ibm.com>,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Hillf Danton <dhillf@gmail.com>
Subject: Re: [PATCH 03/18] mm, hugetlb: unify region structure handling
Date: Tue, 30 Jul 2013 22:57:37 +0530	[thread overview]
Message-ID: <87wqo8ot4m.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1375075929-6119-4-git-send-email-iamjoonsoo.kim@lge.com>

Joonsoo Kim <iamjoonsoo.kim@lge.com> writes:

> Currently, to track a reserved and allocated region, we use two different
> ways for MAP_SHARED and MAP_PRIVATE. For MAP_SHARED, we use
> address_mapping's private_list and, for MAP_PRIVATE, we use a resv_map.
> Now, we are preparing to change a coarse grained lock which protect
> a region structure to fine grained lock, and this difference hinder it.
> So, before changing it, unify region structure handling.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index a3f868a..a1ae3ada 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -366,7 +366,12 @@ static void truncate_hugepages(struct inode *inode, loff_t lstart)
>
>  static void hugetlbfs_evict_inode(struct inode *inode)
>  {
> +	struct resv_map *resv_map;
> +
>  	truncate_hugepages(inode, 0);
> +	resv_map = (struct resv_map *)inode->i_mapping->private_data;
> +	if (resv_map)

can resv_map == NULL ?


> +		kref_put(&resv_map->refs, resv_map_release);

Also the kref_put is confusing. For shared mapping we don't have ref
count incremented right ? So may be you can directly call
resv_map_release or add a comment around explaining this more ?


>  	clear_inode(inode);
>  }
>
> @@ -468,6 +473,11 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
>  					umode_t mode, dev_t dev)
>  {
>  	struct inode *inode;
> +	struct resv_map *resv_map;
> +
> +	resv_map = resv_map_alloc();
> +	if (!resv_map)
> +		return NULL;

-aneesh

--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>, Mel Gorman <mgorman@suse.de>,
	Michal Hocko <mhocko@suse.cz>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Hugh Dickins <hughd@google.com>,
	Davidlohr Bueso <davidlohr.bueso@hp.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Joonsoo Kim <js1304@gmail.com>,
	Wanpeng Li <liwanp@linux.vnet.ibm.com>,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Hillf Danton <dhillf@gmail.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH 03/18] mm, hugetlb: unify region structure handling
Date: Tue, 30 Jul 2013 22:57:37 +0530	[thread overview]
Message-ID: <87wqo8ot4m.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1375075929-6119-4-git-send-email-iamjoonsoo.kim@lge.com>

Joonsoo Kim <iamjoonsoo.kim@lge.com> writes:

> Currently, to track a reserved and allocated region, we use two different
> ways for MAP_SHARED and MAP_PRIVATE. For MAP_SHARED, we use
> address_mapping's private_list and, for MAP_PRIVATE, we use a resv_map.
> Now, we are preparing to change a coarse grained lock which protect
> a region structure to fine grained lock, and this difference hinder it.
> So, before changing it, unify region structure handling.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index a3f868a..a1ae3ada 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -366,7 +366,12 @@ static void truncate_hugepages(struct inode *inode, loff_t lstart)
>
>  static void hugetlbfs_evict_inode(struct inode *inode)
>  {
> +	struct resv_map *resv_map;
> +
>  	truncate_hugepages(inode, 0);
> +	resv_map = (struct resv_map *)inode->i_mapping->private_data;
> +	if (resv_map)

can resv_map == NULL ?


> +		kref_put(&resv_map->refs, resv_map_release);

Also the kref_put is confusing. For shared mapping we don't have ref
count incremented right ? So may be you can directly call
resv_map_release or add a comment around explaining this more ?


>  	clear_inode(inode);
>  }
>
> @@ -468,6 +473,11 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
>  					umode_t mode, dev_t dev)
>  {
>  	struct inode *inode;
> +	struct resv_map *resv_map;
> +
> +	resv_map = resv_map_alloc();
> +	if (!resv_map)
> +		return NULL;

-aneesh


  reply	other threads:[~2013-07-30 17:27 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29  5:31 [PATCH 00/18] mm, hugetlb: remove a hugetlb_instantiation_mutex Joonsoo Kim
2013-07-29  5:31 ` Joonsoo Kim
2013-07-29  5:31 ` [PATCH 01/18] mm, hugetlb: protect reserved pages when softofflining requests the pages Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-29  7:24   ` Hillf Danton
2013-07-29  7:24     ` Hillf Danton
2013-07-31  2:27     ` Joonsoo Kim
2013-07-31  2:27       ` Joonsoo Kim
2013-07-31  2:49       ` Hillf Danton
2013-07-31  2:49         ` Hillf Danton
2013-07-31  4:41         ` Joonsoo Kim
2013-07-31  4:41           ` Joonsoo Kim
2013-07-31  6:21           ` Hillf Danton
2013-07-31  6:21             ` Hillf Danton
2013-07-31  6:37             ` Joonsoo Kim
2013-07-31  6:37               ` Joonsoo Kim
2013-07-31 15:25               ` Hillf Danton
2013-07-31 15:25                 ` Hillf Danton
2013-08-01  6:07                 ` Joonsoo Kim
2013-08-01  6:07                   ` Joonsoo Kim
2013-08-01 16:17                 ` Aneesh Kumar K.V
2013-08-01 16:17                   ` Aneesh Kumar K.V
2013-08-04  5:10                   ` Hillf Danton
2013-08-04  5:10                     ` Hillf Danton
2013-08-05  5:17                     ` Aneesh Kumar K.V
2013-08-05  5:17                       ` Aneesh Kumar K.V
2013-07-30 16:49   ` Aneesh Kumar K.V
2013-07-30 16:49     ` Aneesh Kumar K.V
2013-07-29  5:31 ` [PATCH 02/18] mm, hugetlb: change variable name reservations to resv Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-30 16:50   ` Aneesh Kumar K.V
2013-07-30 16:50     ` Aneesh Kumar K.V
2013-07-29  5:31 ` [PATCH 03/18] mm, hugetlb: unify region structure handling Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-30 17:27   ` Aneesh Kumar K.V [this message]
2013-07-30 17:27     ` Aneesh Kumar K.V
2013-07-31  2:36     ` Joonsoo Kim
2013-07-31  2:36       ` Joonsoo Kim
2013-07-29  5:31 ` [PATCH 04/18] mm, hugetlb: region manipulation functions take resv_map rather list_head Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-29  5:31 ` [PATCH 05/18] mm, hugetlb: protect region tracking via newly introduced resv_map lock Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-29  8:58   ` Hillf Danton
2013-07-29  8:58     ` Hillf Danton
2013-07-31  2:41     ` Joonsoo Kim
2013-07-31  2:41       ` Joonsoo Kim
2013-07-29 18:53   ` Davidlohr Bueso
2013-07-29 18:53     ` Davidlohr Bueso
2013-07-31  2:43     ` Joonsoo Kim
2013-07-31  2:43       ` Joonsoo Kim
2013-07-29  5:31 ` [PATCH 06/18] mm, hugetlb: remove vma_need_reservation() Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-29 17:52   ` Naoya Horiguchi
2013-07-29 17:52     ` Naoya Horiguchi
2013-07-31  4:53     ` Joonsoo Kim
2013-07-31  4:53       ` Joonsoo Kim
2013-07-30 17:49   ` Aneesh Kumar K.V
2013-07-30 17:49     ` Aneesh Kumar K.V
2013-07-31  4:56     ` Joonsoo Kim
2013-07-31  4:56       ` Joonsoo Kim
2013-07-29  5:31 ` [PATCH 07/18] mm, hugetlb: pass has_reserve to dequeue_huge_page_vma() Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-29  5:31 ` [PATCH 08/18] mm, hugetlb: do hugepage_subpool_get_pages() when avoid_reserve Joonsoo Kim
2013-07-29  5:31   ` Joonsoo Kim
2013-07-29 18:05   ` Naoya Horiguchi
2013-07-29 18:05     ` Naoya Horiguchi
2013-07-31  5:02     ` Joonsoo Kim
2013-07-31  5:02       ` Joonsoo Kim
2013-07-31 20:55       ` Naoya Horiguchi
2013-07-31 20:55         ` Naoya Horiguchi
2013-07-29  5:32 ` [PATCH 09/18] mm, hugetlb: unify has_reserve and avoid_reserve to use_reserve Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29  5:32 ` [PATCH 10/18] mm, hugetlb: call vma_has_reserve() before entering alloc_huge_page() Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29 18:27   ` Naoya Horiguchi
2013-07-29 18:27     ` Naoya Horiguchi
2013-07-31  5:06     ` Joonsoo Kim
2013-07-31  5:06       ` Joonsoo Kim
2013-07-29  5:32 ` [PATCH 11/18] mm, hugetlb: move down outside_reserve check Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29 18:39   ` Naoya Horiguchi
2013-07-29 18:39     ` Naoya Horiguchi
2013-07-31  5:08     ` Joonsoo Kim
2013-07-31  5:08       ` Joonsoo Kim
2013-07-31 20:46       ` Naoya Horiguchi
2013-07-31 20:46         ` Naoya Horiguchi
2013-07-29  5:32 ` [PATCH 12/18] mm, hugetlb: remove a check for return value of alloc_huge_page() Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29  5:32 ` [PATCH 13/18] mm, hugetlb: grab a page_table_lock after page_cache_release Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29 18:50   ` Naoya Horiguchi
2013-07-29 18:50     ` Naoya Horiguchi
2013-07-29  5:32 ` [PATCH 14/18] mm, hugetlb: clean-up error handling in hugetlb_cow() Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29  5:32 ` [PATCH 15/18] mm, hugetlb: move up anon_vma_prepare() Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29 19:05   ` Naoya Horiguchi
2013-07-29 19:05     ` Naoya Horiguchi
2013-07-29 19:19     ` Naoya Horiguchi
2013-07-29 19:19       ` Naoya Horiguchi
2013-07-31  5:12       ` Joonsoo Kim
2013-07-31  5:12         ` Joonsoo Kim
2013-07-31 16:43         ` Naoya Horiguchi
2013-07-31 16:43           ` Naoya Horiguchi
2013-07-29  5:32 ` [PATCH 16/18] mm, hugetlb: return a reserved page to a reserved pool if failed Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29 20:19   ` Naoya Horiguchi
2013-07-29 20:19     ` Naoya Horiguchi
2013-07-31  5:21     ` Joonsoo Kim
2013-07-31  5:21       ` Joonsoo Kim
2013-07-29  5:32 ` [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim
2013-07-29  7:28   ` David Gibson
2013-07-31  5:37     ` Joonsoo Kim
2013-07-31  5:37       ` Joonsoo Kim
2013-08-03 10:43       ` David Gibson
2013-08-05  7:36         ` Joonsoo Kim
2013-08-05  7:36           ` Joonsoo Kim
2013-08-07  0:18           ` Davidlohr Bueso
2013-08-07  0:18             ` Davidlohr Bueso
2013-08-07  1:03             ` David Gibson
2013-08-07  1:38               ` Davidlohr Bueso
2013-08-07  1:38                 ` Davidlohr Bueso
2013-08-07  9:18                 ` Joonsoo Kim
2013-08-07  9:18                   ` Joonsoo Kim
2013-08-09  0:02                   ` David Gibson
2013-08-09  9:37                     ` Joonsoo Kim
2013-08-09  9:37                       ` Joonsoo Kim
2013-07-29  5:32 ` [PATCH 18/18] mm, hugetlb: remove a hugetlb_instantiation_mutex Joonsoo Kim
2013-07-29  5:32   ` Joonsoo Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqo8ot4m.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=davidlohr.bueso@hp.com \
    --cc=dhillf@gmail.com \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=js1304@gmail.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liwanp@linux.vnet.ibm.com \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.