From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934Ab1HJPmI (ORCPT ); Wed, 10 Aug 2011 11:42:08 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:59487 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751558Ab1HJPmG (ORCPT ); Wed, 10 Aug 2011 11:42:06 -0400 Message-ID: <4E42A67A.6090803@linux.vnet.ibm.com> Date: Wed, 10 Aug 2011 10:40:42 -0500 From: Seth Jennings User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: Dan Magenheimer CC: Greg Kroah-Hartman , Marcus Klemm , Konrad Wilk , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, kvm@vger.kernel.org, linux-mm , Brian King , Robert Jennings Subject: Re: [PATCH v2] staging: zcache: support multiple clients, prep for KVM and RAMster References: <1d15f28a-56df-4cf4-9dd9-1032f211c0d0@default> <4E429407.8000209@linux.vnet.ibm.com 4E429945.1020008@linux.vnet.ibm.com> <2f1abd2b-4c58-46b4-83bd-18c5338de28e@default> In-Reply-To: <2f1abd2b-4c58-46b4-83bd-18c5338de28e@default> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/2011 10:08 AM, Dan Magenheimer wrote: >> From: Seth Jennings [mailto:sjenning@linux.vnet.ibm.com] >> Subject: Re: [PATCH v2] staging: zcache: support multiple clients, prep for KVM and RAMster >> >>> This crash is hit every time a high memory page is swapped out. >>> >>> I have no solution right now other that to revert this patch and >>> restore the original signatures. > > Hi Seth -- > > Thanks for your testing. I haven't done much testing on 32-bit. > >> Sorry for the noise, but I noticed right after I sent this that >> the tmem layer doesn't DO anything with the data parameter. So >> a possible solution is to just pass the page pointer instead of >> the virtual address. After all, pointers are pointers. > > Yes, this looks like a good patch. > >> --- a/drivers/staging/zcache/zcache.c >> +++ b/drivers/staging/zcache/zcache.c >> @@ -1153,7 +1153,7 @@ static void *zcache_pampd_create(char *data, size_t size, >> size_t clen; >> int ret; >> unsigned long count; >> - struct page *page = virt_to_page(data); >> + struct page *page = (struct page *)(data); >> struct zcache_client *cli = pool->client; >> uint16_t client_id = get_client_id_from_client(cli); >> unsigned long zv_mean_zsize; >> @@ -1220,7 +1220,7 @@ static int zcache_pampd_get_data(char *data, size_t *bufsi >> int ret = 0; >> >> BUG_ON(is_ephemeral(pool)); >> - zv_decompress(virt_to_page(data), pampd); >> + zv_decompress((struct page *)(data), pampd); >> return ret; >> } >> >> @@ -1532,7 +1532,7 @@ static int zcache_put_page(int cli_id, int pool_id, struct >> goto out; >> if (!zcache_freeze && zcache_do_preload(pool) == 0) { >> /* preload does preempt_disable on success */ >> - ret = tmem_put(pool, oidp, index, page_address(page), >> + ret = tmem_put(pool, oidp, index, (char *)(page), >> PAGE_SIZE, 0, is_ephemeral(pool)); >> if (ret < 0) { >> if (is_ephemeral(pool)) >> @@ -1565,7 +1565,7 @@ static int zcache_get_page(int cli_id, int pool_id, struct >> pool = zcache_get_pool_by_id(cli_id, pool_id); >> if (likely(pool != NULL)) { >> if (atomic_read(&pool->obj_count) > 0) >> - ret = tmem_get(pool, oidp, index, page_address(page), >> + ret = tmem_get(pool, oidp, index, (char *)(page), >> &size, 0, is_ephemeral(pool)); >> zcache_put_pool(pool); >> } >> >> I tested this and it works. >> >> Dan, does this mess anything else up? > > Acked-by: Dan Magenheimer > >>> What was the rationale for the signature changes? >>> Seth > > The change on the tmem side allows tmem to handle pre-compressed pages, > which is useful to RAMster and possibly for KVM. The new "raw" > parameter identifies that case, but for zcache "raw" is always zero so > your solution looks fine. > > Seth, could you submit an "official" patch (i.e. proper subject field, > signed-off-by) and I will ack that and ask GregKH to queue it up for > a 3.1-rc? Will do. I'm actually about to send out a set of 3 patches for zcache. There is a Makefile issue, and a 32-bit link-time issue I have found as well. Hopefully, I'll send it out today. > > Subject something like: staging: zcache: fix highmem crash on 32-bit > > Thanks, > Dan > > -- > 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/ . > Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ > Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Seth Jennings Subject: Re: [PATCH v2] staging: zcache: support multiple clients, prep for KVM and RAMster Date: Wed, 10 Aug 2011 10:40:42 -0500 Message-ID: <4E42A67A.6090803@linux.vnet.ibm.com> References: <1d15f28a-56df-4cf4-9dd9-1032f211c0d0@default> <4E429407.8000209@linux.vnet.ibm.com 4E429945.1020008@linux.vnet.ibm.com> <2f1abd2b-4c58-46b4-83bd-18c5338de28e@default> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Greg Kroah-Hartman , Marcus Klemm , Konrad Wilk , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, kvm@vger.kernel.org, linux-mm , Brian King , Robert Jennings To: Dan Magenheimer Return-path: In-Reply-To: <2f1abd2b-4c58-46b4-83bd-18c5338de28e@default> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On 08/10/2011 10:08 AM, Dan Magenheimer wrote: >> From: Seth Jennings [mailto:sjenning@linux.vnet.ibm.com] >> Subject: Re: [PATCH v2] staging: zcache: support multiple clients, prep for KVM and RAMster >> >>> This crash is hit every time a high memory page is swapped out. >>> >>> I have no solution right now other that to revert this patch and >>> restore the original signatures. > > Hi Seth -- > > Thanks for your testing. I haven't done much testing on 32-bit. > >> Sorry for the noise, but I noticed right after I sent this that >> the tmem layer doesn't DO anything with the data parameter. So >> a possible solution is to just pass the page pointer instead of >> the virtual address. After all, pointers are pointers. > > Yes, this looks like a good patch. > >> --- a/drivers/staging/zcache/zcache.c >> +++ b/drivers/staging/zcache/zcache.c >> @@ -1153,7 +1153,7 @@ static void *zcache_pampd_create(char *data, size_t size, >> size_t clen; >> int ret; >> unsigned long count; >> - struct page *page = virt_to_page(data); >> + struct page *page = (struct page *)(data); >> struct zcache_client *cli = pool->client; >> uint16_t client_id = get_client_id_from_client(cli); >> unsigned long zv_mean_zsize; >> @@ -1220,7 +1220,7 @@ static int zcache_pampd_get_data(char *data, size_t *bufsi >> int ret = 0; >> >> BUG_ON(is_ephemeral(pool)); >> - zv_decompress(virt_to_page(data), pampd); >> + zv_decompress((struct page *)(data), pampd); >> return ret; >> } >> >> @@ -1532,7 +1532,7 @@ static int zcache_put_page(int cli_id, int pool_id, struct >> goto out; >> if (!zcache_freeze && zcache_do_preload(pool) == 0) { >> /* preload does preempt_disable on success */ >> - ret = tmem_put(pool, oidp, index, page_address(page), >> + ret = tmem_put(pool, oidp, index, (char *)(page), >> PAGE_SIZE, 0, is_ephemeral(pool)); >> if (ret < 0) { >> if (is_ephemeral(pool)) >> @@ -1565,7 +1565,7 @@ static int zcache_get_page(int cli_id, int pool_id, struct >> pool = zcache_get_pool_by_id(cli_id, pool_id); >> if (likely(pool != NULL)) { >> if (atomic_read(&pool->obj_count) > 0) >> - ret = tmem_get(pool, oidp, index, page_address(page), >> + ret = tmem_get(pool, oidp, index, (char *)(page), >> &size, 0, is_ephemeral(pool)); >> zcache_put_pool(pool); >> } >> >> I tested this and it works. >> >> Dan, does this mess anything else up? > > Acked-by: Dan Magenheimer > >>> What was the rationale for the signature changes? >>> Seth > > The change on the tmem side allows tmem to handle pre-compressed pages, > which is useful to RAMster and possibly for KVM. The new "raw" > parameter identifies that case, but for zcache "raw" is always zero so > your solution looks fine. > > Seth, could you submit an "official" patch (i.e. proper subject field, > signed-off-by) and I will ack that and ask GregKH to queue it up for > a 3.1-rc? Will do. I'm actually about to send out a set of 3 patches for zcache. There is a Makefile issue, and a 32-bit link-time issue I have found as well. Hopefully, I'll send it out today. > > Subject something like: staging: zcache: fix highmem crash on 32-bit > > Thanks, > Dan > > -- > 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/ . > Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ > Don't email: email@kvack.org -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org