-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to the latest master (2.0-pre, then 2.0) #1
Comments
sounds good! |
@atigyi, Thanks for acking. As a quick update, I tried to rebase, but found that due to a recent DNS optimization, a case like used by GoogleIoT regressed. We're looking into it. |
Ok, so the DNS bug is fixed and pushed to master. I've performed a rebase against Zephyr revision bd72ea1 (zephyrproject-rtos@bd72ea1). There were a couple of trivial conflicts in With that, I confirm that the |
@pfalcon, Good news is that the |
@atigyi, thanks for giving it a try! But yeah, that's indeed not too bright news ;-). The point, our work should follow the direction of: on each step, resolve issue and/or reduce technical debt, to lead the changes into a shape which can be submitted as PR to Zephyr upstream. But Zephyr doesn't accept PRs with merge commits (it follows "clean linear history" model, which means rebase workflow model for any WIP changes). So, if we add git merges, we're just accumulating technical debt. Once we got stuff running on qemu_x86, instead of shooting a PR upstream, we'll say "OMG, those merge commits, we yet need to deal with them". So yeah, it would be nice to just avoid them now.
That's what I'd suggest. There's another option - I did this rebase (well, would need to redo on the latest master, there's another important fix went in). So, if it would work for you to take much branch and push into yours, that's another option. But generally, the idea is that you guys take care of this branch, and at all times know and aware how it evolves. So, if I can help anyhow to setup this rebasing process, please let me know. For example, if it would be useful if just recorded all my action during rebase process, as a kind of walk-thru, I can do that. Thanks! |
Currently, the free block bitmap is roughly 4 times larger than it needs to, wasting memory. Let's assume maxsz = 128, minsz = 8 and n_max = 40. Z_MPOOL_LVLS(128, 8) returns 3. The block size for level #0 is 128, the block size for level #1 is 128/4 = 32, and the block size for level #2 is 32/4 = 8. Hence levels 0, 1, and 2 for a total of 3 levels. So far so good. Now let's look at Z_MPOOL_LBIT_WORDS(). We get: Z_MPOOL_LBIT_WORDS_UNCLAMPED(40, 0) = ((40 << 0) + 31) / 32 = 2 Z_MPOOL_LBIT_WORDS_UNCLAMPED(40, 1) = ((40 << 2) + 31) / 32 = 5 Z_MPOOL_LBIT_WORDS_UNCLAMPED(40, 2) = ((40 << 4) + 31) / 32 = 20 None of those are < 2 so Z_MPOOL_LBIT_WORDS() takes the results from Z_MPOOL_LBIT_WORDS_UNCLAMPED(). Finally, let's look at _MPOOL_BITS_SIZE(. It sums all possible levels with Z_MPOOL_LBIT_BYTES() which is: #define Z_MPOOL_LBIT_BYTES(maxsz, minsz, l, n_max) \ (Z_MPOOL_LVLS((maxsz), (minsz)) >= (l) ? \ 4 * Z_MPOOL_LBIT_WORDS((n_max), l) : 0) Or given what we already have: Z_MPOOL_LBIT_BYTES(128, 8, 0, 40) = (3 >= 0) ? 4 * 2 : 0 = 8 Z_MPOOL_LBIT_BYTES(128, 8, 1, 40) = (3 >= 1) ? 4 * 5 : 0 = 20 Z_MPOOL_LBIT_BYTES(128, 8, 2, 40) = (3 >= 2) ? 4 * 20 : 0 = 80 Z_MPOOL_LBIT_BYTES(128, 8, 3, 40) = (3 >= 3) ? 4 * ?? Wait... we're missing this one: Z_MPOOL_LBIT_WORDS_UNCLAMPED(40, 3) = ((40 << 6) + 31) / 32 = 80 then: Z_MPOOL_LBIT_BYTES(128, 8, 3, 40) = (3 >= 3) ? 4 * 80 : 0 = 320 Further levels yeld (3 >= 4), (3 >= 5), etc. so they're all false and produce 0. So this means that we're statically allocating 428 bytes to the bitmap when clearly only the first 3 Z_MPOOL_LBIT_BYTES() results for the corresponding 3 levels that we have should be summed e.g. only 108 bytes. Here the code logic gets confused between level numbers and the number levels, hence the extra allocation which happens to be exponential. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Ok, seems to be fixed, see commit history. Base is at the 33000th commit of Zephyr/master eddf058 :) |
As github says for this repo:
I.e., there's quite a lot of developments went into Zephyr lately, and it makes sense to work on top of them, to make sure GoogleIoT sample works with soon-to-be-released Zephyr 2.0 (and of course, the sample would go into master, so we should test with it).
Proposed plan: I'll test the rebase, and if works as expected, will ask @atigyi to perform the rebase on his side and push it. Let me know how that sounds.
The text was updated successfully, but these errors were encountered: