From: "Aurélien Aptel" <aaptel@suse.com>
To: Rohith Surabattula <rohiths.msft@gmail.com>,
Steve French <smfrench@gmail.com>
Cc: Shyam Prasad N <nspmangalore@gmail.com>,
linux-cifs <linux-cifs@vger.kernel.org>,
sribhat.msa@outlook.com,
ronnie sahlberg <ronniesahlberg@gmail.com>
Subject: Re: cifs: Deferred close for files
Date: Mon, 12 Apr 2021 18:57:54 +0200 [thread overview]
Message-ID: <87blaj30fh.fsf@suse.com> (raw)
In-Reply-To: <CACdtm0avBPeuxEvfymnVk4eYCYO3fCiywJWH0VYmVGiM2OL9_A@mail.gmail.com>
I have added test cifs/105 that triggers oplock breaks. I think it could
be used as a base or be modified to test your code (unless you already
have some script). In anycase I would like to make sure we can trigger
the codepath you are adding on the buildbot. My script is in
/root/buildbot/scripts/fedora29/cifs/105 and it simply calls the
optest.py script in the same directory.
The code is essentially:
for x in range(n_children):
pid = os.fork()
if pid == 0:
for i in range(n_it):
a = open(fna, 'w+') # file accessed by first mount point A
b = open(fnb, 'r') # same file via 2nd mount point B
b.close()
a.close()
exit(0)
That python script mounts the same share twice but with -o nosharesock,
to disable connection reuse (so you have 2 TCP connection).
Then it creates n_children, and each children is opening/closing for
read or write the same file (but accessed through different mount
point) in a loop (n_it times).
If a process has opened it for READ it will open it with a READ lease,
so that multiple client can cache reads.
As soon as one process opens it for writes, it will make the server
notify clients that have a READ lease on the file to downgrade it. This
notification is the oplock break.
Cheers,
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
next prev parent reply other threads:[~2021-04-12 16:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 9:11 cifs: Deferred close for files Rohith Surabattula
2021-03-11 13:47 ` Shyam Prasad N
2021-03-11 17:55 ` Tom Talpey
2021-03-22 17:07 ` Rohith Surabattula
2021-03-24 14:20 ` Tom Talpey
2021-03-25 2:42 ` Rohith Surabattula
2021-04-07 14:57 ` Rohith Surabattula
2021-04-11 12:19 ` Rohith Surabattula
2021-04-11 18:49 ` Steve French
2021-04-12 3:43 ` Rohith Surabattula
2021-04-12 16:57 ` Aurélien Aptel [this message]
2021-04-12 17:23 ` Steve French
2021-04-12 17:24 ` Steve French
2021-04-12 19:35 ` Rohith Surabattula
2021-04-19 23:03 ` Steve French
2021-04-28 3:30 ` Rohith Surabattula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87blaj30fh.fsf@suse.com \
--to=aaptel@suse.com \
--cc=linux-cifs@vger.kernel.org \
--cc=nspmangalore@gmail.com \
--cc=rohiths.msft@gmail.com \
--cc=ronniesahlberg@gmail.com \
--cc=smfrench@gmail.com \
--cc=sribhat.msa@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.