linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andre.przywara@foss.arm.com (Andre Przywara)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] KVM: arm/arm64: vgic: Add debugfs vgic-state file
Date: Tue, 24 Jan 2017 12:35:43 +0000	[thread overview]
Message-ID: <1b65df04-0b3d-b012-ac33-9b3727a66c7c@foss.arm.com> (raw)
In-Reply-To: <20170124122954.GO15850@cbox>

Hi,

[...]

>>>>
>>>> As I didn't understand the seq_* semantics in the first place, I didn't
>>>> have a look yet what could cause this.
>>>
>>> Nice catch, I'll have a look at this.
>>>
>>> Just so I'm sure, these are two processes reading the vgic-state file
>>> for the same single VM, right?
>>
>> Yes, just one VM. I was about to write a small test program which is a
>> bit more nasty and launches <n> threads all doing lseek();read(); on the
>> same file in a loop, but it turned out that this isn't necessary ;-)
>> I have that now working, so I can give this a test later.
>>
>> I was wondering if you could ditch that lseek / offset setting feature
>> at all? The smaller debugfs files don't support it as well (ESPIPE on
>> lseek()). Is that an option when setting up the seq interface?
>>
> 
> I think that only works if you're guaranteed to always only print within
> the buffer allocated for a single read, but if you run out of buffer
> space the seq_file code will allocate more space, do the fast forward
> thing, and continue reading where it left off.  I feel like when we're
> enumaring over 1000 irqs and could be spitting out a bunch of LPI data
> later on, this is a bit fragile.
> The recommendations also state you should only do this if you don't need
> a lot of locking or printing small data amounts, but I'm not enough of
> an expert on the seq file to know exactly when that applies and when it
> doesn't, but it doesn't feel like this fits within that bracket.

Thanks for the explanation, and this indeed makes some sense.
I just wanted to save you some nasty debugging, instead tricking you
into just papering over the issue ;-)

Cheers,
Andre.

  reply	other threads:[~2017-01-24 12:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 10:33 [PATCH] KVM: arm/arm64: vgic: Add debugfs vgic-state file Christoffer Dall
2017-01-20 18:07 ` Andre Przywara
2017-01-20 20:07   ` Christoffer Dall
2017-01-20 23:05     ` André Przywara
2017-01-24 10:23 ` Andre Przywara
2017-01-24 10:58   ` Christoffer Dall
2017-01-24 12:25     ` Andre Przywara
2017-01-24 12:29       ` Christoffer Dall
2017-01-24 12:35         ` Andre Przywara [this message]
2017-01-24 12:52           ` Christoffer Dall
2017-01-24 13:22   ` Christoffer Dall

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=1b65df04-0b3d-b012-ac33-9b3727a66c7c@foss.arm.com \
    --to=andre.przywara@foss.arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).