#define OBD_ALLOC(ptr, cast, size) \
do { \
- if (size <= 4096) { \
- ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \
- CDEBUG(D_MALLOC, "kmalloced: %d at %x.\n", \
- (int) size, (int) ptr); \
- } else { \
- ptr = (cast)vmalloc((unsigned long) size); \
- CDEBUG(D_MALLOC, "vmalloced: %d at %x.\n", \
- (int) size, (int) ptr); \
- } \
+ ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \
+ obd_memory += size; \
+ CDEBUG(D_MALLOC, "kmalloced: %d at %x (tot %ld).\n", \
+ (int) size, (int) ptr, obd_memory); \
if (ptr == 0) { \
printk("kernel malloc returns 0 at %s:%d\n", \
__FILE__, __LINE__); \
} else { \
memset(ptr, 0, size); \
- obd_memory += size; \
} \
} while (0)
-#define OBD_FREE(ptr,size) \
-do { \
- if (size <= 4096) { \
- kfree((ptr)); \
- CDEBUG(D_MALLOC, "kfreed: %d at %x.\n", \
- (int) size, (int) ptr); \
- } else { \
- vfree((ptr)); \
- CDEBUG(D_MALLOC, "vfreed: %d at %x.\n", \
- (int) size, (int) ptr); \
- } \
- obd_memory -= size; \
+#define OBD_FREE(ptr,size) \
+do { \
+ kfree((ptr)); \
+ obd_memory -= size; \
+ CDEBUG(D_MALLOC, "kfreed: %d at %x (tot %ld).\n", \
+ (int) size, (int) ptr, obd_memory); \
} while (0)
pupdated->state == TASK_INTERRUPTIBLE )) {
unsigned long timeout = HZ/20;
unsigned long count = 0;
+ CDEBUG(D_CACHE, "\n");
send_sig_info(SIGTERM, (struct siginfo *)1, pupdated);
+ CDEBUG(D_CACHE, "\n");
while (pupdated) {
+ CDEBUG(D_CACHE, "\n");
if ((count % 2*HZ) == timeout)
printk(KERN_INFO "wait for pupdated to stop\n");
- count += timeout;
+ CDEBUG(D_CACHE, "\n");
+ count += timeout;
set_current_state(TASK_INTERRUPTIBLE);
+ CDEBUG(D_CACHE, "\n");
schedule_timeout(timeout);
+ CDEBUG(D_CACHE, "\n");
}
+ CDEBUG(D_CACHE, "\n");
}
EXIT;
- /* not reached */
return 0;
-
}