linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, highmem: remove useless virtual variable in page_address_map
@ 2013-04-22  8:26 Joonsoo Kim
  2013-04-25 22:00 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Joonsoo Kim @ 2013-04-22  8:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-mm, Minchan Kim, Joonsoo Kim

We can get virtual address without virtual field.
So remove it.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

diff --git a/mm/highmem.c b/mm/highmem.c
index b32b70c..8f4c250 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -320,7 +320,6 @@ EXPORT_SYMBOL(kunmap_high);
  */
 struct page_address_map {
 	struct page *page;
-	void *virtual;
 	struct list_head list;
 };
 
@@ -362,7 +361,10 @@ void *page_address(const struct page *page)
 
 		list_for_each_entry(pam, &pas->lh, list) {
 			if (pam->page == page) {
-				ret = pam->virtual;
+				int nr;
+
+				nr = pam - page_address_map;
+				ret = PKMAP_ADDR(nr);
 				goto done;
 			}
 		}
@@ -391,7 +393,6 @@ void set_page_address(struct page *page, void *virtual)
 	if (virtual) {		/* Add */
 		pam = &page_address_maps[PKMAP_NR((unsigned long)virtual)];
 		pam->page = page;
-		pam->virtual = virtual;
 
 		spin_lock_irqsave(&pas->lock, flags);
 		list_add_tail(&pam->list, &pas->lh);
-- 
1.7.9.5

--
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>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm, highmem: remove useless virtual variable in page_address_map
  2013-04-22  8:26 [PATCH] mm, highmem: remove useless virtual variable in page_address_map Joonsoo Kim
@ 2013-04-25 22:00 ` Andrew Morton
  2013-04-26  0:21   ` Joonsoo Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2013-04-25 22:00 UTC (permalink / raw)
  To: Joonsoo Kim; +Cc: linux-kernel, linux-mm, Minchan Kim

On Mon, 22 Apr 2013 17:26:28 +0900 Joonsoo Kim <iamjoonsoo.kim@lge.com> wrote:

> We can get virtual address without virtual field.
> So remove it.
> 
> ...
>
> --- a/mm/highmem.c
> +++ b/mm/highmem.c
> @@ -320,7 +320,6 @@ EXPORT_SYMBOL(kunmap_high);
>   */
>  struct page_address_map {
>  	struct page *page;
> -	void *virtual;
>  	struct list_head list;
>  };
>  
> @@ -362,7 +361,10 @@ void *page_address(const struct page *page)
>  
>  		list_for_each_entry(pam, &pas->lh, list) {
>  			if (pam->page == page) {
> -				ret = pam->virtual;
> +				int nr;
> +
> +				nr = pam - page_address_map;

Doesn't compile.  Presumably you meant page_address_maps.

I'll drop this - please resend if/when it has been runtime tested.


--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm, highmem: remove useless virtual variable in page_address_map
  2013-04-25 22:00 ` Andrew Morton
@ 2013-04-26  0:21   ` Joonsoo Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Joonsoo Kim @ 2013-04-26  0:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-mm, Minchan Kim

On Thu, Apr 25, 2013 at 03:00:57PM -0700, Andrew Morton wrote:
> On Mon, 22 Apr 2013 17:26:28 +0900 Joonsoo Kim <iamjoonsoo.kim@lge.com> wrote:
> 
> > We can get virtual address without virtual field.
> > So remove it.
> > 
> > ...
> >
> > --- a/mm/highmem.c
> > +++ b/mm/highmem.c
> > @@ -320,7 +320,6 @@ EXPORT_SYMBOL(kunmap_high);
> >   */
> >  struct page_address_map {
> >  	struct page *page;
> > -	void *virtual;
> >  	struct list_head list;
> >  };
> >  
> > @@ -362,7 +361,10 @@ void *page_address(const struct page *page)
> >  
> >  		list_for_each_entry(pam, &pas->lh, list) {
> >  			if (pam->page == page) {
> > -				ret = pam->virtual;
> > +				int nr;
> > +
> > +				nr = pam - page_address_map;
> 
> Doesn't compile.  Presumably you meant page_address_maps.
> 
> I'll drop this - please resend if/when it has been runtime tested.

Sorry for that.
I'll resend when it has been runtime tested.

Thanks.

> 
> 
> --
> 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>

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-26  0:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22  8:26 [PATCH] mm, highmem: remove useless virtual variable in page_address_map Joonsoo Kim
2013-04-25 22:00 ` Andrew Morton
2013-04-26  0:21   ` Joonsoo Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).