From: Richard Palethorpe <rpalethorpe@suse.de>
To: Li Wang <liwang@redhat.com>
Cc: kernel-team <kernel-team@android.com>, LTP List <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v1] fzsync: break inf loop with flag vs pthread_cancel
Date: Mon, 11 Apr 2022 10:17:09 +0100 [thread overview]
Message-ID: <87k0bwgebk.fsf@suse.de> (raw)
In-Reply-To: <CAEemH2eh=AX6-DMW1UaVs+MGtqFXq8HoJD41D3paB93vQZ9ZUw@mail.gmail.com>
Hello Li,
Li Wang <liwang@redhat.com> writes:
> Hi Richard, Edward,
>
> On Mon, Apr 11, 2022 at 4:33 PM Richard Palethorpe <rpalethorpe@suse.de> wrote:
>
> > Looking at tst_fzsync_run_a, if anything goes wrong in other places
> > (thread_b) and break with setting 'pair->exit' to 1 to end the looping.
> > It doesn't work for thread_a because tst_atomic_store(exit, &pair->exit)
> > will reset it back to 0 (int exit = 0).
>
> I don't think we have ever handled thread B breaking gracefully?
>
> Right, that exist before Edward's patch :).
>
>
>
> If B breaks and it calls tst_fzsync_pair_cleanup then it will try to
> join to itself and we will probably get EDEADLK.
>
> Exactly, maybe do something to make tst_fzsync_pair_cleanup
> avoid joining to itself when the invoke come from B?
I suppose we could save thread A or B's TID and then check it. I think
that should be in a seperate patch.
>
>
> > + tst_atomic_store(1, &pair->exit);
> > + usleep(100000);
>
> Why do we need usleep?
>
> Seems not very needed.
+1
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-04-11 9:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 17:06 [LTP] [PATCH v1] fzsync: break inf loop with flag vs pthread_cancel Edward Liaw via ltp
2022-04-06 5:39 ` Petr Vorel
2022-04-07 7:06 ` Li Wang
2022-04-11 7:51 ` Richard Palethorpe
2022-04-11 9:01 ` Li Wang
2022-04-11 9:17 ` Richard Palethorpe [this message]
2022-04-11 9:35 ` Li Wang
2022-04-11 15:13 ` Edward Liaw via ltp
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=87k0bwgebk.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=kernel-team@android.com \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox