Krishna iResearch Intelligent Cloud Platform - VIRtual Generic Os - VIRGO - Linux kernel extensions for cloud
 All Classes
virgocloudexecmempoolsvc.h
1 /***************************************************************************************
2 VIRGO - a linux module extension with CPU and Memory pooling with cloud capabilities
3 
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 --------------------------------------------------------------------------------------------------
19 Copyright (C):
20 Srinivasan Kannan (alias) Ka.Shrinivaasan (alias) Shrinivas Kannan
21 Independent Open Source Developer, Researcher and Consultant
22 Ph: 9003082186, 9791165980
23 Open Source Products Profile(Krishna iResearch): http://sourceforge.net/users/ka_shrinivaasan
24 Personal website(research): https://sites.google.com/site/kuja27/
25 emails: ka.shrinivaasan@gmail.com, shrinivas.kannan@gmail.com, kashrinivaasan@live.com
26 --------------------------------------------------------------------------------------------------
27 
28 *****************************************************************************************/
29 
30 #ifndef _LINUX_VIRGOCLOUDEXECMEMPOOLSVC_H
31 #define _LINUX_VIRGOCLOUDEXECMEMPOOLSVC_H
32 
33 #include <linux/virgo_mempool.h>
34 #include <linux/socket.h>
35 
36 
37 int virgo_cloudexec_mempool_service(void* args)
38 {
39 
40  try_module_get(virgo_mempool_class.m_virgo_owner);
41  while(1)
42  {
43  printk(KERN_INFO "virgo_cloudexec_mempool_service(): virgo_mempool_ops.virgo_create() \n");
44  struct socket* clsock = virgo_mempool_ops.virgo_mempool_create();
45 
46  /*
47  Multithreaded VIRGO Memory Pooling Kernel Service
48  -------------------------------------------------
49  */
50 
51 
52  struct task_struct *task;
53  void* args=clsock;
54  int woken_up=0;
55  printk(KERN_INFO "virgo_cloudexec_mempool_service(): virgo mempool client thread per request \n");
56  task=kthread_create(virgo_mempool_client_thread, (void*)args, "virgo memorypool client thread per virgo_clone request");
57  woken_up=wake_up_process(task);
58 
59  /*
60  virgo_ops.virgo_recvfrom();
61  virgo_ops.virgo_sendto();
62  */
63  }
64 
65 }
66 
67 /*
68 Multithreaded VIRGO Memory Pooling Kernel Service
69 -------------------------------------------------
70 */
71 
72 int virgo_mempool_client_thread(void* args)
73 {
74  /*mutex_lock(&virgo_mempool_mutex);*/
75  struct socket* clientsock=(struct socket*)args;
76  printk(KERN_INFO "virgo_mempool_client_thread(): virgo_mempool_ops.virgo_mempool_recvfrom()\n");
77  char *virgo_mempool_ret=(char*)virgo_mempool_ops.virgo_mempool_recvfrom(clientsock);
78  printk(KERN_INFO "virgo_mempool_client_thread(): virgo_mempool_ops.virgo_mempool_sendto()\n");
79  virgo_mempool_ops.virgo_mempool_sendto(clientsock, virgo_mempool_ret);
80  /*mutex_unlock(&virgo_mempool_mutex);*/
81 }
82 
83 #endif