public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* how to cope with "Scheduling in interrupt" problem
@ 2005-04-04  5:38 MingJie Chang
  0 siblings, 0 replies; 3+ messages in thread
From: MingJie Chang @ 2005-04-04  5:38 UTC (permalink / raw)
  To: linux-kernel

Dear all,

I try to modify inet_sendmsg() and inet_recvmsg().
To defer the time to notify a receiver, I use a timer for the problem.
But it causes "Scheduling in interrupt" error.
Is there any method to reform it?

Thank you for tour help


Scheduling in interrupt
invalid operand: 0000
CPU:    0
EIP:    0819:[<c0005d6f>]    Not tainted
EFLAGS: 00010286
eax: 00000018   ebx: c19c2000   ecx: c0170894   edx: fbff9000
esi: c19c2000   edi: c1d42da0   ebp: c19c3cf4   esp: c19c3cd0
ds: 0821   es: 0821   ss: 0821
Process ftp (pid: 1312, stackpage=c19c3000)<1>



EX:
inet_sendmsg()
{
	.
	.
	.
BYE:
	
	if(sock->send_nonnotify_size>0&&0==sock->send_set_timer)
	{
		sock->send_notify_timer.function=notify_receiver;		
		sock->send_notify_timer.expires=MY_EXT_NOTIFY_TIME + jiffies;
		sock->send_notify_timer.data=(unsigned long)(sock);
		
		dbprintk("set notify timer, sock addr=%p\n",sock);
		add_timer(&sock->send_notify_timer);
		sock->send_set_timer=1;
	
	}
	release_sock(sock->sk);	
}

static void notify_receiver(unsigned long data)
{
	struct socket* sock=(struct socket*)data;
	struct SHM_INFO shm_tmp;
	
	if(!sock||!sock->sk)
		return;

	lock_sock(sock->sk);
	sock->send_set_timer=0;

	if(sock->send_nonnotify_size)
	{
		dbprintk("notify_receiver:notify
receivers,size=%d\n",sock->send_nonnotify_size);
		sock->send_nonnotify_size=0;

		shm_tmp.saddr=ntohl(sock->sk->saddr);
		shm_tmp.sport=ntohl(sock->sk->sport);

		shm_tmp.reqaddr=shm_tmp.saddr;
		shm_tmp.reqport=shm_tmp.sport;
		
		shm_tmp.daddr=ntohl(sock->sk->daddr);
		shm_tmp.dport=ntohl(sock->sk->dport);
		shm_tmp.maddr=NULL;
		release_sock(sock->sk);
		
		dbprintk("notift_recv: call send_data()......");
		HYPERVISOR_send_data(&shm_tmp);
		dbprintk("done\n");
		return;
	}	
	
	release_sock(sock->sk);
}

^ permalink raw reply	[flat|nested] 3+ messages in thread
* how to cope with "Scheduling in interrupt" problem
@ 2005-04-04  5:51 MingChieh
  0 siblings, 0 replies; 3+ messages in thread
From: MingChieh @ 2005-04-04  5:51 UTC (permalink / raw)
  To: linux-kernel

Dear all,

I try to modify inet_sendmsg() and inet_recvmsg().
To defer the time to notify a receiver, I use a timer for the problem.
But it causes "Scheduling in interrupt" error.
Is there any method to reform it?

Thank you for tour help


MingChieh Chang,
Taiwan


Scheduling in interrupt
invalid operand: 0000
CPU: 0
EIP: 0819:[<c0005d6f>] Not tainted
EFLAGS: 00010286
eax: 00000018 ebx: c19c2000 ecx: c0170894 edx: fbff9000
esi: c19c2000 edi: c1d42da0 ebp: c19c3cf4 esp: c19c3cd0
ds: 0821 es: 0821 ss: 0821
Process ftp (pid: 1312, stackpage=c19c3000)<1>



EX:
inet_sendmsg()
{
.
.
.
BYE:

if(sock->send_nonnotify_size>0&&0==sock->send_set_timer)
{
sock->send_notify_timer.function=notify_receiver;
sock->send_notify_timer.expires=MY_EXT_NOTIFY_TIME + jiffies;
sock->send_notify_timer.data=(unsigned long)(sock);

dbprintk("set notify timer, sock addr=%p\n",sock);
add_timer(&sock->send_notify_timer);
sock->send_set_timer=1;

}
release_sock(sock->sk);
}

static void notify_receiver(unsigned long data)
{
struct socket* sock=(struct socket*)data;
struct SHM_INFO shm_tmp;

if(!sock||!sock->sk)
return;

lock_sock(sock->sk);
sock->send_set_timer=0;

if(sock->send_nonnotify_size)
{
dbprintk("notify_receiver:notify
receivers,size=%d\n",sock->send_nonnotify_size);
sock->send_nonnotify_size=0;

shm_tmp.saddr=ntohl(sock->sk->saddr);
shm_tmp.sport=ntohl(sock->sk->sport);

shm_tmp.reqaddr=shm_tmp.saddr;
shm_tmp.reqport=shm_tmp.sport;

shm_tmp.daddr=ntohl(sock->sk->daddr);
shm_tmp.dport=ntohl(sock->sk->dport);
shm_tmp.maddr=NULL;
release_sock(sock->sk);

dbprintk("notift_recv: call send_data()......");
HYPERVISOR_send_data(&shm_tmp);
dbprintk("done\n");
return;
}

release_sock(sock->sk);
}



^ permalink raw reply	[flat|nested] 3+ messages in thread
* how to cope with "Scheduling in interrupt" problem
@ 2005-04-04  4:40 MingJie Chang
  0 siblings, 0 replies; 3+ messages in thread
From: MingJie Chang @ 2005-04-04  4:40 UTC (permalink / raw)
  To: linux-kernel

Dear all,

I try to modify inet_sendmsg() and inet_recvmsg().
To defer the time to notify a receiver, I use a timer for the problem.
But it causes "Scheduling in interrupt" error.
Is there any method to reform it?

Thank you for tour help

Error:

Scheduling in interrupt
invalid operand: 0000
CPU:    0
EIP:    0819:[<c0005d6f>]    Not tainted
EFLAGS: 00010286
eax: 00000018   ebx: c19c2000   ecx: c0170894   edx: fbff9000
esi: c19c2000   edi: c1d42da0   ebp: c19c3cf4   esp: c19c3cd0
ds: 0821   es: 0821   ss: 0821
Process ftp (pid: 1312, stackpage=c19c3000)<1>


code:
inet_sendmsg()
{
	.
	.
	.
BYE:
	
	if(sock->send_nonnotify_size>0&&0==sock->send_set_timer)
	{
		sock->send_notify_timer.function=notify_receiver;		
		sock->send_notify_timer.expires=MY_EXT_NOTIFY_TIME + jiffies;
		sock->send_notify_timer.data=(unsigned long)(sock);
		
		dbprintk("set notify timer, sock addr=%p\n",sock);
		add_timer(&sock->send_notify_timer);
		sock->send_set_timer=1;
	
	}
	release_sock(sock->sk);	
}

static void notify_receiver(unsigned long data)
{
	struct socket* sock=(struct socket*)data;
	struct SHM_INFO shm_tmp;
	
	if(!sock||!sock->sk)
		return;

	lock_sock(sock->sk);
	sock->send_set_timer=0;

	if(sock->send_nonnotify_size)
	{
		dbprintk("notify_receiver:notify
receivers,size=%d\n",sock->send_nonnotify_size);
		sock->send_nonnotify_size=0;

		shm_tmp.saddr=ntohl(sock->sk->saddr);
		shm_tmp.sport=ntohl(sock->sk->sport);

		shm_tmp.reqaddr=shm_tmp.saddr;
		shm_tmp.reqport=shm_tmp.sport;
		
		shm_tmp.daddr=ntohl(sock->sk->daddr);
		shm_tmp.dport=ntohl(sock->sk->dport);
		shm_tmp.maddr=NULL;
		release_sock(sock->sk);
		
		dbprintk("notift_recv: call send_data()......");
		HYPERVISOR_send_data(&shm_tmp);
		dbprintk("done\n");
		return;
	}	
	
	release_sock(sock->sk);
}

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

end of thread, other threads:[~2005-04-04  5:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-04  5:38 how to cope with "Scheduling in interrupt" problem MingJie Chang
  -- strict thread matches above, loose matches on Subject: below --
2005-04-04  5:51 MingChieh
2005-04-04  4:40 MingJie Chang

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