public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RPCSVC_MAXPAGES doesn't account for overhead(?) pages
@ 2003-03-22 16:46 Zwane Mwaikambo
  2003-03-22 16:52 ` Zwane Mwaikambo
  0 siblings, 1 reply; 5+ messages in thread
From: Zwane Mwaikambo @ 2003-03-22 16:46 UTC (permalink / raw)
  To: Linux Kernel; +Cc: William Lee Irwin III

I got this BUG with a 32k PAGE_SIZE, it looks like we unconditionally 
allocate 2 extra pages on top of requested size so we wouldn't be able to 
service a maximum payload from nfsd.

Is there a more suitable/elegant fix?

------------[ cut here ]------------
kernel BUG at net/sunrpc/svc.c:121!
invalid operand: 0000
CPU:    0
EIP:    0060:[<c03e6baf>]    Not tainted
EFLAGS: 00010202
EIP is at svc_init_buffer+0x2f/0x80
eax: 00000002   ebx: 00000004   ecx: 000000d0   edx: 000001e0
esi: 00000000   edi: cba45948   ebp: fffffff4   esp: c9b99f28
ds: 007b   es: 007b   ss: 0068
Process rpc.nfsd (pid: 762, threadinfo=c9b98000 task=cace0700)
Stack: cba45948 c98bad44 00008400 c03e6d73 cba45948 00008400 c05a2f10 00000007 
       00000000 00000801 c01e31b1 c01e3330 c98bad44 c7c38004 00000008 00000002 
       cb4f7690 c01e3a5c 00000801 00000008 00000008 caf385d4 c7c38000 00000000 
Call Trace:
 [<c03e6d73>] svc_create_thread+0xa3/0xe0
 [<c01e31b1>] nfsd_svc+0xb1/0x230
 [<c01e3330>] nfsd+0x0/0x480
 [<c01e3a5c>] TA_write+0x10c/0x160
 [<c018597a>] sys_nfsservctl+0xba/0x100
 [<c0109477>] syscall_call+0x7/0xb

Code: 0f 0b 79 00 5d 05 48 c0 85 db 74 25 90 8d 74 26 00 31 d2 b9 


-- 
function.linuxpower.ca

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

* Re: RPCSVC_MAXPAGES doesn't account for overhead(?) pages
  2003-03-22 16:46 RPCSVC_MAXPAGES doesn't account for overhead(?) pages Zwane Mwaikambo
@ 2003-03-22 16:52 ` Zwane Mwaikambo
  2003-03-22 17:11   ` William Lee Irwin III
  2003-03-23 11:18   ` Trond Myklebust
  0 siblings, 2 replies; 5+ messages in thread
From: Zwane Mwaikambo @ 2003-03-22 16:52 UTC (permalink / raw)
  To: Linux Kernel; +Cc: William Lee Irwin III

On Sat, 22 Mar 2003, Zwane Mwaikambo wrote:

> I got this BUG with a 32k PAGE_SIZE, it looks like we unconditionally 
> allocate 2 extra pages on top of requested size so we wouldn't be able to 
> service a maximum payload from nfsd.
> 
> Is there a more suitable/elegant fix?

I forgot the patch...

Index: linux-2.5.65-pgcl/include/linux/sunrpc/svc.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.65/include/linux/sunrpc/svc.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 svc.h
--- linux-2.5.65-pgcl/include/linux/sunrpc/svc.h	17 Mar 2003 23:08:31 -0000	1.1.1.1
+++ linux-2.5.65-pgcl/include/linux/sunrpc/svc.h	22 Mar 2003 16:22:22 -0000
@@ -73,7 +73,8 @@ struct svc_serv {
  * This assumes that the non-page part of an rpc reply will fit
  * in a page - NFSd ensures this.  lockd also has no trouble.
  */
-#define RPCSVC_MAXPAGES		((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1)
+
+#define RPCSVC_MAXPAGES		(2+((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE+1))
 
 static inline u32 svc_getu32(struct iovec *iov)
 {

-- 
function.linuxpower.ca

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

* Re: RPCSVC_MAXPAGES doesn't account for overhead(?) pages
  2003-03-22 16:52 ` Zwane Mwaikambo
@ 2003-03-22 17:11   ` William Lee Irwin III
  2003-03-23 11:18   ` Trond Myklebust
  1 sibling, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2003-03-22 17:11 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel

On Sat, Mar 22, 2003 at 11:52:44AM -0500, Zwane Mwaikambo wrote:
> I forgot the patch...
> -#define RPCSVC_MAXPAGES		((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1)
> +#define RPCSVC_MAXPAGES		(2+((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE+1))


This looks fine to me. Applied, thanks.


-- wli

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

* Re: RPCSVC_MAXPAGES doesn't account for overhead(?) pages
  2003-03-22 16:52 ` Zwane Mwaikambo
  2003-03-22 17:11   ` William Lee Irwin III
@ 2003-03-23 11:18   ` Trond Myklebust
  2003-03-23 11:42     ` William Lee Irwin III
  1 sibling, 1 reply; 5+ messages in thread
From: Trond Myklebust @ 2003-03-23 11:18 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel, William Lee Irwin III

>>>>> " " == Zwane Mwaikambo <zwane@holomorphy.com> writes:


     > -#define RPCSVC_MAXPAGES
     > ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1) + +#define
     > RPCSVC_MAXPAGES
     > (2+((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE+1))
 
Huh? RPCSVC_MAXPAYLOAD is set at 64k. Should be quite ample for a 32k
read or write.

Cheers,
  Trond

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

* Re: RPCSVC_MAXPAGES doesn't account for overhead(?) pages
  2003-03-23 11:18   ` Trond Myklebust
@ 2003-03-23 11:42     ` William Lee Irwin III
  0 siblings, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2003-03-23 11:42 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Zwane Mwaikambo, Linux Kernel

" " == Zwane Mwaikambo <zwane@holomorphy.com> writes:
>> -#define RPCSVC_MAXPAGES
>> ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 1) + +#define
>> RPCSVC_MAXPAGES
>> (2+((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE+1))

On Sun, Mar 23, 2003 at 12:18:57PM +0100, Trond Myklebust wrote:
> Huh? RPCSVC_MAXPAYLOAD is set at 64k. Should be quite ample for a 32k
> read or write.

Sure, there's just a dependency on PAGE_SIZE we're trying to get sorted
out here. If PAGE_SIZE is 64KB (e.g. IA64, pgcl) then this trips a BUG().


-- wli

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

end of thread, other threads:[~2003-03-23 11:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-22 16:46 RPCSVC_MAXPAGES doesn't account for overhead(?) pages Zwane Mwaikambo
2003-03-22 16:52 ` Zwane Mwaikambo
2003-03-22 17:11   ` William Lee Irwin III
2003-03-23 11:18   ` Trond Myklebust
2003-03-23 11:42     ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox