Well i went to see how do_mmap allocates memory and came to know following things.
1)do_mmap is used by mmap system call and it maps file/any other thing to process address space.
2) when i called do_mmap directly inside kernel module, there was no process address space so kernel uses previous process's address space ( which can be of insmod process) and does mmap in that process's address space.
Therefore when i was trying to access that mapped memory inside same module , i got access to it was in same address space , but same thing when i tried to access same mapped memory from other module, that second module was not having access to mapped area in this address space and thus it segfaulted.
conclusion: do_mmap can not be used to mmap a file inside kernel module. (if u want to access that mapped area from same module then it might work)
Note: I just got this information by going through source code and discussing with some people. I might be wrong in whatever i mentioned above, if so please correct me.
finally i have decide to mmap file in userspace and pass values to kernel module.
Thanks to all who entertained my question.