gramineproject / graphene

Graphene / Graphene-SGX - a library OS for Linux multi-process applications, with Intel SGX support
https://grapheneproject.io
GNU Lesser General Public License v3.0
770 stars 260 forks source link

Stress-ng test lockf hangs with Graphene #2510

Open jinengandhi-intel opened 3 years ago

jinengandhi-intel commented 3 years ago

Description of the problem

Description of lockf test

start  N workers that randomly lock and unlock regions of a file
#   using the POSIX lockf(3) locking mechanism. Each worker  creates
#   a  64  KB file and attempts to hold a maximum of 1024 concurrent
#   locks with a child process that also tries to hold 1024  concur‐
#   rent  locks.  Old  locks  are  unlocked in a first-in, first-out
#   basis.

Link to the lockf stress-ng test source code: https://github.com/ColinIanKing/stress-ng/blob/master/stress-lockf.c

This test when run under Graphene hangs for any number of stressors. I have attached the logs for lockf running with 8 stressors as well as 1 stressor. lockf_8stressor.log lockf_1stressor.log

Steps to reproduce

Commands to run the lockf stressor

graphene-direct stress-ng --lockf 1 --timeout 60s 
graphene-direct stress-ng --lockf 8 --timeout 60s 

Expected results

Actual results

dimakuv commented 3 years ago

@pwmarcz This will be interesting for you. That's a cool stress test for your F_SETLK implementation in Graphene.

pwmarcz commented 3 years ago

I will take a look. One big limitation of the current locks is that they're uninterruptible, that might be it.