Hi there,

I'm investigating an problem where I see block I/O twice the maximum
allowed size in max_hw_sectors_kb. In my case the device driver simply
fails. I have to investigate that part further... Nevertheless I think there
might be some strange calculation bug in ondemand_readahead().

Assume user reads 1M of data and the device driver can only handle
this 1M. In initial_readahead we will set ra->size to 1M and async size
to 1M too.

initial_readahead:
  ra->start = offset;
  ra->size = get_init_ra_size(req_size, max_pages);
  ra->async_size = ra->size > req_size ? ra->size - req_size : ra->size;

In the readit part the check succeeds and the function will double
the amount to read ahead.

readit:
  /*
   * Will this read hit the readahead marker made by itself?
   * If so, trigger the readahead marker hit now, and merge
   * the resulted next readahead window into the current one.
   */
  if (offset == ra->start && ra->size == ra->async_size) {
    ra->async_size = get_next_ra_size(ra, max_pages);
    ra->size += ra->async_size;
  }

Btrace of dd if=/dev/fioa1 of=/dev/null bs=1M count=1 gives:

253,0   20        1     0.000000000 19784  A   R 2048 + 4096 <- (253,1) 0
253,0   20        2     0.000003330 19784  Q   R 2048 + 4096 [dd]
253,0   20        3     0.000235833 19784  C   R 2048 + 4096 [0]

Initial commit was 122a21d11... (readahead: on-demand readahead
logic) and the readit part was extended by 51daa88eb... (readahead:
remove sync/async readahead call dependency)

I'm lost where one should implement a fix. In the first part of
the calculation or the second? Or am I totally wrong?

Thanks for your help and best regards.

Markus

****************************************************************************
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

Über das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.

Collogia AG
Ubierring 11
D-50678 Köln

Vorstand:
Kadir Akin
Dr. Michael Höhnerbach

Vorsitzender des Aufsichtsrates:
Hans Kristian Langva

Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

e-mails sent over the internet may have been written under a wrong name or
been manipulated. That is why this message sent as an e-mail is not a
legally binding declaration of intention.

Collogia AG
Ubierring 11
D-50678 Köln

executive board:
Kadir Akin
Dr. Michael Höhnerbach

President of the supervisory board:
Hans Kristian Langva

Registry office: district court Cologne
Register number: HRB 52 497

****************************************************************************

Reply via email to